- VERSION (1.0.0) + build.sh: bump patch/minor/major e deploy via docker compose - Dockerfile: ARG/ENV APP_VERSION + BUILD_TIME (iniettati come build-arg) - version.build_info(): env in Docker, fallback file VERSION + '(local)' in dev - GET /api/version; badge #appVersionPill nell'header (tooltip = build time) - test_version.py: env vs fallback Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
34 lines
918 B
Docker
34 lines
918 B
Docker
FROM python:3.10-slim
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends libgl1 libglib2.0-0 curl && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
|
|
|
|
WORKDIR /app
|
|
|
|
COPY pyproject.toml README.md ./
|
|
COPY src/ src/
|
|
RUN uv sync --no-dev
|
|
|
|
COPY config.yaml VERSION ./
|
|
COPY web/ web/
|
|
|
|
ENV PRESA_MANO_CONFIG=/app/config.yaml
|
|
ENV PRESA_MANO_DATA=/app/data
|
|
ENV PRESA_MANO_PORT=8890
|
|
|
|
# Versione build: iniettata da build.sh come --build-arg. Cambia ad ogni build
|
|
# (il valore diverso invalida solo questi due layer finali, non le dipendenze).
|
|
ARG APP_VERSION=dev
|
|
ARG BUILD_TIME=unknown
|
|
ENV APP_VERSION=${APP_VERSION}
|
|
ENV BUILD_TIME=${BUILD_TIME}
|
|
|
|
EXPOSE 8890
|
|
|
|
# Shell form so $PRESA_MANO_PORT viene espanso a runtime: cambi la porta in
|
|
# .env senza dover ricostruire l'immagine.
|
|
CMD uv run uvicorn presa_mano.main:app --host 0.0.0.0 --port ${PRESA_MANO_PORT}
|