feat: minimal prod compose with watchtower auto-updates

This commit is contained in:
Jonas Miederer 2026-09-07 09:05:51 +00:00
parent 338cdcf108
commit 94f353d773
4 changed files with 166 additions and 0 deletions

21
backend/Dockerfile Normal file
View file

@ -0,0 +1,21 @@
# Production image for the FastAPI backend.
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
WORKDIR /srv/backend
COPY pyproject.toml alembic.ini ./
COPY app ./app
COPY migrations ./migrations
COPY scripts ./scripts
# No lockfile is committed; dependencies resolve at build time.
RUN uv sync --no-dev
ENV FLOWS_WATCH_ENABLED=true
EXPOSE 8000
# Migrate on start, then serve (watcher reconciles backend/flows automatically).
CMD ["sh", "-c", ".venv/bin/alembic upgrade head && exec .venv/bin/uvicorn app.main:app --host 0.0.0.0 --port 8000"]