rajkhanke commited on
Commit
da5fed4
·
verified ·
1 Parent(s): c0ed7f3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -3
Dockerfile CHANGED
@@ -4,14 +4,20 @@ FROM python:3.9-slim
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
- # Copy application files
8
- COPY . /app
9
 
10
  # Install dependencies
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
 
 
 
 
 
 
13
  # Expose the port your app runs on
14
  EXPOSE 7860
15
 
16
  # Command to run the application
17
- CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]
 
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
+ # Copy only the requirements first (to leverage Docker cache)
8
+ COPY requirements.txt /app/requirements.txt
9
 
10
  # Install dependencies
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # Copy the rest of the application files
14
+ COPY . /app
15
+
16
+ # Create the directory for cached images
17
+ RUN mkdir -p cache_images
18
+
19
  # Expose the port your app runs on
20
  EXPOSE 7860
21
 
22
  # Command to run the application
23
+ CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]