- app.py: /api/models filtered to gemma+aya, /api/translate streams NDJSON from Ollama with stream:true, /healthz for k8s probes - static/index.html: dark-mode UI, three dropdowns (source/target/model), live token streaming with spinner+pulse+timer indicators - Dockerfile: two-stage uv build, slim Python 3.13 runtime - .gitea/workflows/build.yml: multi-arch (amd64+arm64) build, push to Scaleway registry on push to main - build.sh: manual fallback if Gitea Actions isn't available
29 lines
680 B
Docker
29 lines
680 B
Docker
# syntax=docker/dockerfile:1.7
|
|
|
|
# Build stage: install deps into a venv with uv.
|
|
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS builder
|
|
|
|
ENV UV_LINK_MODE=copy \
|
|
UV_COMPILE_BYTECODE=1 \
|
|
UV_PROJECT_ENVIRONMENT=/app/.venv
|
|
|
|
WORKDIR /app
|
|
COPY pyproject.toml uv.lock ./
|
|
RUN uv sync --frozen --no-dev --no-install-project
|
|
|
|
# Runtime stage: slim Python, just the venv + app code.
|
|
FROM python:3.13-slim-bookworm
|
|
|
|
ENV PATH="/app/.venv/bin:$PATH" \
|
|
PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
|
|
WORKDIR /app
|
|
COPY --from=builder /app/.venv /app/.venv
|
|
COPY app.py ./
|
|
COPY static ./static
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|