Files
PRISM/backend/Dockerfile
T
boris.waaubandClaude Sonnet 5.5 b552b9240f
Deploy test / deploy (push) Failing after 1m13s
Ajoute le déploiement continu sur prism-test
- .gitea/workflows/deploy-test.yaml : à chaque push sur main, publie
  les images sur Harbor, met à jour les pods du namespace prism-test
  (kubectl set image), attend le rollout et contrôle le site
- settings : base de données via DB_* (à défaut de DATABASE_URL),
  fichiers statiques servis par WhiteNoise, HTTPS derrière le proxy
- Dockerfile : collectstatic à la construction de l'image
- dépendance whitenoise, README : section Déploiement

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 16:24:26 +01:00

29 lines
876 B
Docker

FROM python:3.12-slim
COPY --from=ghcr.io/astral-sh/uv:0.9 /uv /usr/local/bin/uv
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy \
UV_PROJECT_ENVIRONMENT=/opt/venv \
PATH="/opt/venv/bin:$PATH"
WORKDIR /app
ARG UV_SYNC_ARGS="--no-dev"
COPY pyproject.toml uv.lock ./
RUN uv sync --locked $UV_SYNC_ARGS
COPY . .
# Fichiers statiques (admin Django, schéma OpenAPI) servis par WhiteNoise.
RUN SECRET_KEY=build DEBUG=False ALLOWED_HOSTS=localhost CSRF_TRUSTED_ORIGINS=http://localhost \
DATABASE_URL=sqlite:////tmp/build.db python manage.py collectstatic --noinput
RUN useradd --system --uid 1000 prism && chown -R prism /app
USER prism
EXPOSE 8000
CMD ["gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "3", "--access-logformat", "%(h)s %(t)s \"%(m)s %(U)s\" %(s)s %(b)s"]