mike23415 commited on
Commit
a45f4a4
·
verified ·
1 Parent(s): 8a1bb06

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -6
Dockerfile CHANGED
@@ -1,5 +1,6 @@
1
  FROM python:3.9-slim
2
 
 
3
  WORKDIR /app
4
 
5
  # Install system dependencies
@@ -12,19 +13,22 @@ RUN apt-get update && apt-get install -y \
12
  RUN mkdir -p /tmp/hf_home /tmp/cache /tmp/diffusers_cache && \
13
  chmod -R 777 /tmp
14
 
15
- # Copy requirements and install dependencies
16
  COPY requirements.txt .
17
- RUN pip install --no-cache-dir -r requirements.txt
18
 
19
- # Copy application code
 
 
 
 
20
  COPY app.py .
21
 
22
- # Set environment variables
23
  ENV HF_HOME=/tmp/hf_home
24
  ENV XDG_CACHE_HOME=/tmp/cache
25
 
26
- # Expose the port
27
  EXPOSE 7860
28
 
29
- # Command to run the application
30
  CMD ["python", "app.py"]
 
1
  FROM python:3.9-slim
2
 
3
+ # Set working directory
4
  WORKDIR /app
5
 
6
  # Install system dependencies
 
13
  RUN mkdir -p /tmp/hf_home /tmp/cache /tmp/diffusers_cache && \
14
  chmod -R 777 /tmp
15
 
16
+ # Copy and install Python dependencies
17
  COPY requirements.txt .
 
18
 
19
+ # Use python -m pip to avoid "old script wrapper" warnings
20
+ RUN python -m pip install --upgrade pip && \
21
+ python -m pip install --no-cache-dir -r requirements.txt
22
+
23
+ # Copy app code
24
  COPY app.py .
25
 
26
+ # Set required env variables
27
  ENV HF_HOME=/tmp/hf_home
28
  ENV XDG_CACHE_HOME=/tmp/cache
29
 
30
+ # Expose the Flask port
31
  EXPOSE 7860
32
 
33
+ # Run the Flask app
34
  CMD ["python", "app.py"]