Update Dockerfile
Browse files- Dockerfile +30 -3
Dockerfile
CHANGED
@@ -1,5 +1,32 @@
|
|
1 |
-
|
|
|
|
|
|
|
2 |
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
COPY . .
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use Python 3.9 slim image for smaller size
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set working directory
|
5 |
WORKDIR /app
|
6 |
+
|
7 |
+
# Install system dependencies
|
8 |
+
RUN apt-get update && apt-get install -y \
|
9 |
+
ffmpeg \
|
10 |
+
&& rm -rf /var/lib/apt/lists/*
|
11 |
+
|
12 |
+
# Copy requirements first to leverage Docker cache
|
13 |
+
COPY requirements.txt .
|
14 |
+
|
15 |
+
# Install Python dependencies
|
16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
+
|
18 |
+
# Copy application code
|
19 |
COPY . .
|
20 |
+
|
21 |
+
# Create directories for temporary files
|
22 |
+
RUN mkdir -p /app/images /app/videos
|
23 |
+
|
24 |
+
# Set environment variables
|
25 |
+
ENV PYTHONUNBUFFERED=1
|
26 |
+
ENV PORT=8080
|
27 |
+
|
28 |
+
# Expose port
|
29 |
+
EXPOSE 8080
|
30 |
+
|
31 |
+
# Set the entrypoint command
|
32 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "--workers", "1", "--threads", "8", "--timeout", "0", "app:app"]
|