Files
soleprint/rig/examples/starter/Dockerfile.example
2026-09-22 05:15:49 -03:00

25 lines
786 B
Docker

# EXAMPLE component image. Copy, rename, replace:
# Dockerfile.api -> image <cluster>-api -> image: in k8s/base/api.yaml
# COPY paths are relative to the build context the overlay's Tiltfile names (context='.').
# Notes: rig's docs/notes/Dockerfile.example.md
FROM python:3.12-slim
WORKDIR /app
# Dependencies first, in their own layer, so a source edit does not reinstall them.
COPY api/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Context-relative — see above.
COPY api/ ./api/
# Match this with the containerPort in the manifest and the target of the
# Service in front of it.
EXPOSE 8000
CMD ["python", "-m", "api"]
# live_update: the Tiltfile's sync('api', '/app/api') must match COPY api/ + WORKDIR /app,
# or edits silently do nothing.