-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (19 loc) · 780 Bytes
/
Dockerfile
File metadata and controls
27 lines (19 loc) · 780 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
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
# System deps:
# - ca-certificates helps HTTPS/TLS (DB + model providers)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
COPY . /app
# Create runtime dirs (also mounted as volumes in docker-compose)
RUN mkdir -p /app/static/images /app/reports
EXPOSE 8000
# IMPORTANT: app.py stores per-session state in-memory (user_data_store).
# Multiple Gunicorn workers would each have their own memory, causing session_id lookups to fail.
CMD ["sh", "-c", "gunicorn -w 1 -b 0.0.0.0:${PORT:-8000} app:app"]