-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (25 loc) · 1.12 KB
/
Copy pathDockerfile
File metadata and controls
32 lines (25 loc) · 1.12 KB
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
# SafeBARS container image — optional, reproducible deployment target.
#
# Render currently deploys via its Python buildpack (see render.yaml,
# `env: python`), which is the active configuration. This Dockerfile exists so
# the exact runtime can be reproduced locally and, if desired, switched on
# Render by setting `env: docker` + `dockerfile: Dockerfile` in render.yaml
# (behaviour is otherwise identical — same gunicorn command, same Python 3.12).
#
# Build: docker build -t safebars .
# Run: docker run --rm -p 5000:5000 -e FLASK_SECRET_KEY=dev-only safebars
# Health: curl http://localhost:5000/healthz
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PORT=5000
WORKDIR /app
# Install dependencies first to maximize layer caching.
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Application code.
COPY . .
EXPOSE 5000
# Mirrors render.yaml startCommand (single worker keeps the Free Tier memory
# footprint small; --timeout 120 covers slow LLM-backed responses).
CMD ["gunicorn", "wsgi:app", "--bind", "0.0.0.0:5000", "--workers", "1", "--timeout", "120"]