Muhammad541 commited on
Commit
d04c875
·
verified ·
1 Parent(s): d607da0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -9
Dockerfile CHANGED
@@ -1,18 +1,27 @@
1
- FROM python:3.9-slim
 
2
 
 
3
  WORKDIR /app
4
 
 
5
  COPY requirements.txt .
6
- RUN pip install --no-cache-dir -r requirements.txt
7
 
8
- COPY app.py .
9
- COPY ./data /app/data
10
- RUN ls -la /app/data
 
 
 
 
 
 
11
 
12
- RUN mkdir -p /app/cache && chmod -R 777 /app/cache
13
- ENV HF_HOME=/app/cache
14
- ENV TRANSFORMERS_CACHE=/app/cache
15
 
 
16
  EXPOSE 7860
17
 
18
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ # Use an official Python runtime as the base image
2
+ FROM python:3.11-slim
3
 
4
+ # Set working directory inside the container
5
  WORKDIR /app
6
 
7
+ # Copy requirements.txt to the working directory
8
  COPY requirements.txt .
 
9
 
10
+ # Install system dependencies (for faiss, torch, etc.)
11
+ RUN apt-get update && apt-get install -y \
12
+ build-essential \
13
+ libatlas-base-dev \
14
+ gfortran \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Install Python dependencies
18
+ RUN pip install --no-cache-dir -r requirements.txt
19
 
20
+ # Copy the entire application code and datasets to the container
21
+ COPY . .
 
22
 
23
+ # Expose the port your Flask app will run on (7860 as specified in app.py)
24
  EXPOSE 7860
25
 
26
+ # Command to run the Flask app
27
+ CMD ["python", "app.py"]