mike23415 commited on
Commit
4f75f0e
·
verified ·
1 Parent(s): 829dfd4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -11
Dockerfile CHANGED
@@ -2,26 +2,25 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  git \
8
- libpng-dev \
9
- libjpeg-dev \
10
- libgl1-mesa-glx \
11
- && rm -rf /var/lib/apt/lists/*
12
-
13
- RUN mkdir -p /tmp/hf_home /tmp/cache /tmp/diffusers_cache && \
14
- chmod -R 777 /tmp
15
 
 
16
  COPY requirements.txt .
17
- RUN python -m pip install --upgrade pip && \
18
- python -m pip install --no-cache-dir -r requirements.txt -v
19
 
 
20
  COPY app.py .
21
 
22
- ENV HF_HOME=/tmp/hf_home
23
- ENV XDG_CACHE_HOME=/tmp/cache
 
24
 
 
25
  EXPOSE 7860
26
 
 
27
  CMD ["python", "app.py"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  git \
9
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
10
 
11
+ # Copy requirements and install Python dependencies
12
  COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
 
14
 
15
+ # Copy application code
16
  COPY app.py .
17
 
18
+ # Set environment variables
19
+ ENV GRADIO_SERVER_NAME=0.0.0.0
20
+ ENV GRADIO_SERVER_PORT=7860
21
 
22
+ # Expose the port
23
  EXPOSE 7860
24
 
25
+ # Run the application
26
  CMD ["python", "app.py"]