Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +14 -8
Dockerfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# Use
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
# Set environment variables
|
@@ -6,27 +6,33 @@ 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 \
|
16 |
curl \
|
17 |
libgl1-mesa-glx \
|
18 |
libglib2.0-0 \
|
|
|
|
|
|
|
19 |
&& rm -rf /var/lib/apt/lists/*
|
20 |
|
21 |
-
# Copy requirements
|
22 |
COPY requirements.txt .
|
|
|
|
|
|
|
23 |
RUN pip install --no-cache-dir -r requirements.txt
|
24 |
|
25 |
-
# Copy
|
26 |
COPY . .
|
27 |
|
28 |
-
# Expose port
|
29 |
EXPOSE 7860
|
30 |
|
31 |
-
#
|
32 |
-
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|
|
|
1 |
+
# Use Python 3.9 base image
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
# Set environment variables
|
|
|
6 |
PYTHONUNBUFFERED=1 \
|
7 |
PORT=7860
|
8 |
|
9 |
+
# Set working directory
|
10 |
WORKDIR /app
|
11 |
|
12 |
+
# Install system dependencies including ffmpeg
|
13 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
14 |
ffmpeg \
|
15 |
git \
|
16 |
curl \
|
17 |
libgl1-mesa-glx \
|
18 |
libglib2.0-0 \
|
19 |
+
libsm6 \
|
20 |
+
libxrender1 \
|
21 |
+
libxext6 \
|
22 |
&& rm -rf /var/lib/apt/lists/*
|
23 |
|
24 |
+
# Copy requirements.txt
|
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 --no-cache-dir -r requirements.txt
|
30 |
|
31 |
+
# Copy app files
|
32 |
COPY . .
|
33 |
|
34 |
+
# Expose port for Hugging Face
|
35 |
EXPOSE 7860
|
36 |
|
37 |
+
# Start the Flask app with Gunicorn
|
38 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|