gajjukhan commited on
Commit
944d45c
·
verified ·
1 Parent(s): 5ba9c67

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -15
Dockerfile CHANGED
@@ -1,37 +1,28 @@
1
  FROM python:3.10-slim
2
 
3
- # System dependencies
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
- ffmpeg \
6
- libgl1 \
7
- libglib2.0-0 \
8
- libsm6 \
9
- libxext6 \
10
- libxrender1 \
11
- wget \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Create non-root user (HF Spaces requirement)
15
  RUN useradd -m -u 1000 user
 
16
  WORKDIR /app
17
 
18
- # Install Python dependencies
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir --upgrade pip && \
21
  pip install --no-cache-dir -r requirements.txt
22
 
23
- # Copy application code
24
  COPY --chown=user:user . .
25
 
26
- # Switch to non-root user
 
 
27
  USER user
28
 
29
- # Expose Gradio port
30
  EXPOSE 7860
31
 
32
- # Set environment variables
33
  ENV GRADIO_SERVER_NAME=0.0.0.0
34
  ENV GRADIO_SERVER_PORT=7860
35
  ENV PYTHONUNBUFFERED=1
36
 
37
- CMD ["python", "app.py"]
 
1
  FROM python:3.10-slim
2
 
 
3
  RUN apt-get update && apt-get install -y --no-install-recommends \
4
+ ffmpeg libgl1 libglib2.0-0 libsm6 libxext6 libxrender1 wget \
 
 
 
 
 
 
5
  && rm -rf /var/lib/apt/lists/*
6
 
 
7
  RUN useradd -m -u 1000 user
8
+
9
  WORKDIR /app
10
 
 
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir --upgrade pip && \
13
  pip install --no-cache-dir -r requirements.txt
14
 
 
15
  COPY --chown=user:user . .
16
 
17
+ # Create writable model cache directory
18
+ RUN mkdir -p /home/user/models && chown user:user /home/user/models
19
+
20
  USER user
21
 
 
22
  EXPOSE 7860
23
 
 
24
  ENV GRADIO_SERVER_NAME=0.0.0.0
25
  ENV GRADIO_SERVER_PORT=7860
26
  ENV PYTHONUNBUFFERED=1
27
 
28
+ CMD ["python", "app.py"]