Elalimy commited on
Commit
b930e18
·
verified ·
1 Parent(s): 2f3517d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -2
Dockerfile CHANGED
@@ -4,7 +4,14 @@ FROM python:3.10-slim
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
- # Copy application files into the container
 
 
 
 
 
 
 
8
  COPY . /app
9
 
10
  # Create and set permissions for the uploads and cache directories
@@ -13,7 +20,6 @@ RUN mkdir -p /app/uploads /app/.cache && chmod 777 /app/uploads /app/.cache
13
  # Set environment variable for the cache directory
14
  ENV XDG_CACHE_HOME=/app/.cache
15
 
16
-
17
  # Expose the application port
18
  EXPOSE 7860
19
 
 
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
+ # Copy requirements.txt before other files to leverage Docker cache
8
+ COPY requirements.txt /app/requirements.txt
9
+
10
+ # Install dependencies
11
+ RUN pip install --upgrade pip && \
12
+ pip install --no-cache-dir -r /app/requirements.txt
13
+
14
+ # Copy the rest of the application files into the container
15
  COPY . /app
16
 
17
  # Create and set permissions for the uploads and cache directories
 
20
  # Set environment variable for the cache directory
21
  ENV XDG_CACHE_HOME=/app/.cache
22
 
 
23
  # Expose the application port
24
  EXPOSE 7860
25