Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +13 -15
Dockerfile
CHANGED
|
@@ -1,15 +1,14 @@
|
|
| 1 |
-
# Use Python 3.9 base image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
#
|
| 5 |
ENV PYTHONDONTWRITEBYTECODE=1 \
|
| 6 |
PYTHONUNBUFFERED=1 \
|
| 7 |
PORT=7860
|
| 8 |
|
| 9 |
-
#
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
-
# Install system dependencies
|
| 13 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 14 |
ffmpeg \
|
| 15 |
git \
|
|
@@ -19,24 +18,23 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 19 |
libsm6 \
|
| 20 |
libxrender1 \
|
| 21 |
libxext6 \
|
|
|
|
|
|
|
| 22 |
&& rm -rf /var/lib/apt/lists/*
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
COPY requirements.txt .
|
| 26 |
-
|
| 27 |
-
# Upgrade pip to avoid version issues and install dependencies
|
| 28 |
RUN pip install --upgrade pip
|
| 29 |
-
RUN pip install
|
| 30 |
|
| 31 |
-
#
|
| 32 |
-
|
| 33 |
-
RUN
|
| 34 |
|
| 35 |
-
# Copy
|
| 36 |
COPY . .
|
| 37 |
|
| 38 |
-
# Expose
|
| 39 |
EXPOSE 7860
|
| 40 |
|
| 41 |
-
#
|
| 42 |
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
+
# Environment configuration
|
| 4 |
ENV PYTHONDONTWRITEBYTECODE=1 \
|
| 5 |
PYTHONUNBUFFERED=1 \
|
| 6 |
PORT=7860
|
| 7 |
|
| 8 |
+
# Working directory
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
+
# Install system dependencies
|
| 12 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 13 |
ffmpeg \
|
| 14 |
git \
|
|
|
|
| 18 |
libsm6 \
|
| 19 |
libxrender1 \
|
| 20 |
libxext6 \
|
| 21 |
+
llvm \
|
| 22 |
+
build-essential \
|
| 23 |
&& rm -rf /var/lib/apt/lists/*
|
| 24 |
|
| 25 |
+
# Pre-install numpy to resolve numba setup dependency
|
|
|
|
|
|
|
|
|
|
| 26 |
RUN pip install --upgrade pip
|
| 27 |
+
RUN pip install numpy==1.21.6
|
| 28 |
|
| 29 |
+
# Copy requirements and install remaining dependencies
|
| 30 |
+
COPY requirements.txt .
|
| 31 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 32 |
|
| 33 |
+
# Copy all application files
|
| 34 |
COPY . .
|
| 35 |
|
| 36 |
+
# Expose Hugging Face Gradio/Flask port
|
| 37 |
EXPOSE 7860
|
| 38 |
|
| 39 |
+
# Launch app with Gunicorn
|
| 40 |
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|