-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (31 loc) · 808 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM python:3.9-slim
# Install FFmpeg and cleanup
RUN apt-get update && \
apt-get install -y ffmpeg && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
RUN pip install -r requirements.txt
# Copy the rest of the application
COPY . .
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PORT=8080
ENV TIMEOUT=300
ENV WORKER_CLASS=sync
ENV WORKERS=1
ENV THREADS=1
# Create directory for temporary files
RUN mkdir -p /app/temp
# Expose the port
EXPOSE 8080
# Command to run the application with increased timeout
CMD gunicorn app:app \
--bind 0.0.0.0:8080 \
--timeout ${TIMEOUT} \
--workers ${WORKERS} \
--threads ${THREADS} \
--worker-class ${WORKER_CLASS} \
--log-level debug