OrbitMC commited on
Commit
50f8981
·
verified ·
1 Parent(s): 7bbfa6a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -16
Dockerfile CHANGED
@@ -1,19 +1,19 @@
1
- FROM python:3.11-slim [cite: 1]
2
 
3
- # System deps
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
  ffmpeg git \
6
- && rm -rf /var/lib/apt/lists/* [cite: 1]
7
 
8
- # HF Spaces requires uid 1000
9
- RUN useradd -m -u 1000 user [cite: 1]
10
  USER user
11
- ENV PATH="/home/user/.local/bin:$PATH" [cite: 1]
12
- ENV HF_HOME="/home/user/.cache/huggingface" [cite: 1]
13
 
14
- WORKDIR /home/user/app [cite: 1]
15
 
16
- # Install Python deps — Including gunicorn for stability
17
  RUN pip install --no-cache-dir --upgrade pip && \
18
  pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu \
19
  torch==2.6.0+cpu \
@@ -22,15 +22,13 @@ RUN pip install --no-cache-dir --upgrade pip && \
22
  flask==3.1.1 \
23
  gunicorn \
24
  huggingface_hub>=0.27.0 \
25
- edge-tts [cite: 1]
26
 
27
- # Copy project files
28
- COPY --chown=user:user . . [cite: 2]
29
-
30
- # Make sure img dir exists
31
- RUN mkdir -p /home/user/app/img [cite: 1]
32
 
33
  EXPOSE 7860
34
 
35
- # Use gunicorn to avoid health-check timeouts
36
  CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app", "--timeout", "120"]
 
1
+ FROM python:3.11-slim
2
 
3
+ # System dependencies
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
  ffmpeg git \
6
+ && rm -rf /var/lib/apt/lists/*
7
 
8
+ # Setup user for Hugging Face (UID 1000)
9
+ RUN useradd -m -u 1000 user
10
  USER user
11
+ ENV PATH="/home/user/.local/bin:$PATH"
12
+ ENV HF_HOME="/home/user/.cache/huggingface"
13
 
14
+ WORKDIR /home/user/app
15
 
16
+ # Install dependencies
17
  RUN pip install --no-cache-dir --upgrade pip && \
18
  pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu \
19
  torch==2.6.0+cpu \
 
22
  flask==3.1.1 \
23
  gunicorn \
24
  huggingface_hub>=0.27.0 \
25
+ edge-tts
26
 
27
+ # Copy files and create image directory
28
+ COPY --chown=user:user . .
29
+ RUN mkdir -p /home/user/app/img
 
 
30
 
31
  EXPOSE 7860
32
 
33
+ # Start with Gunicorn for better stability
34
  CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app", "--timeout", "120"]