Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|