-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (32 loc) · 1005 Bytes
/
Dockerfile
File metadata and controls
42 lines (32 loc) · 1005 Bytes
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
40
41
42
# Use Python 3.12 slim image
FROM python:3.12-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
ffmpeg \
curl \
gcc \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Install cloudflared
RUN curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb \
&& dpkg -i cloudflared.deb \
&& rm cloudflared.deb
# Set working directory
WORKDIR /app
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt && \
pip install gunicorn
# Copy application code
COPY . .
# Create temp directory for downloads
RUN mkdir -p /app/temp
# Set environment variables
ENV FLASK_APP=app.py
ENV PYTHONUNBUFFERED=1
ENV FLASK_ENV=production
# Expose port
EXPOSE 5000
# Run the application with gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "4", "--timeout", "120", "app:app"]