-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (18 loc) · 772 Bytes
/
Copy pathDockerfile
File metadata and controls
25 lines (18 loc) · 772 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
# Dockerfile — packages the Flask app into a small Linux image for deployment.
#
# Why multi-stage is skipped here: for teaching, a single stage is easier to read.
# The app listens on port 5000 inside the container; docker-compose maps it to the host.
FROM python:3.12-slim-bookworm
# Safer Python behavior in containers
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install dependencies first (better layer caching when only code changes)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Application source
COPY . .
# Flask dev server — for real production, use gunicorn/waitress behind a reverse proxy
EXPOSE 5000
# Default command; docker-compose can override environment variables
CMD ["python", "app.py"]