Update Dockerfile
Browse files- Dockerfile +14 -16
Dockerfile
CHANGED
|
@@ -1,19 +1,19 @@
|
|
| 1 |
-
FROM python:3.11-slim
|
| 2 |
|
| 3 |
-
# System
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
ffmpeg git \
|
| 6 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
-
#
|
| 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
|
| 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
|
| 26 |
|
| 27 |
-
# Copy
|
| 28 |
-
COPY --chown=user:user . .
|
| 29 |
-
|
| 30 |
-
# Make sure img dir exists
|
| 31 |
-
RUN mkdir -p /home/user/app/img [cite: 1]
|
| 32 |
|
| 33 |
EXPOSE 7860
|
| 34 |
|
| 35 |
-
#
|
| 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"]
|