-
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.29 KB
/
Copy pathDockerfile
File metadata and controls
32 lines (25 loc) Β· 1.29 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
# Salvo β container image for Railway (or any Docker host).
# Stateless FastAPI backend: batch creative factory (genblaze Pipeline β B2 sink β ranking).
FROM python:3.11-slim
# uv for reproducible, lockfile-pinned installs.
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
WORKDIR /app
# Dependency layer first (cached across source changes). --frozen honors uv.lock.
# NOTE: dev deps are installed on purpose β the OFFLINE/demo engine uses
# genblaze_core.testing (Mock providers), whose module imports `pytest`, so pytest
# is a *runtime* dependency of the credential-free demo path, not just a test tool.
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-install-project
# App source, then install the project itself.
COPY . .
RUN uv sync --frozen
# OFFLINE by default: mock providers + LocalDirBackend, zero credentials β the
# always-green demo path. To run LIVE, set B2_KEY_ID / B2_APP_KEY (+ a provider key)
# as service env vars β the app auto-detects credentials and switches to real B2.
ENV OFFLINE=1 \
PYTHONUNBUFFERED=1 \
PORT=8000
EXPOSE 8000
# Railway injects $PORT. Bind 0.0.0.0 and run the venv uvicorn directly (uv run
# would re-sync at boot). Shell form so ${PORT} expands.
CMD .venv/bin/python -m uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-8000}