feat(server): packaging Docker Compose et push Gitea Registry (ticket #52)

Ajoute le Dockerfile multi-stage (build dart:stable, runtime
debian:bookworm-slim avec ca-certificates, exécutable AOT compilé), le
docker-compose.yaml (API + Postgres avec healthcheck et
depends_on: service_healthy), .env.example, .dockerignore et les
scripts scripts/docker-entrypoint.sh (migration au démarrage) et
scripts/push-gitea-image.sh (aucun identifiant en dur, mot de passe
via --password-stdin). dart analyze clean, dart test 24/24 vert,
`docker compose config` valide (syntaxe, interpolation de variables,
healthcheck). Dockerfile et scripts relus manuellement et jugés
corrects ; pas de docker build/compose up réel faute d'accès au
daemon Docker dans ce sandbox.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-19 10:40:11 +02:00
parent 14e04784ed
commit f03dead3e4
8 changed files with 205 additions and 2 deletions

View File

@ -0,0 +1,42 @@
services:
api:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
PORT: 8080
MIGRATE_ON_STARTUP: ${MIGRATE_ON_STARTUP:?set MIGRATE_ON_STARTUP}
DATABASE_HOST: ${DATABASE_HOST:?set DATABASE_HOST}
DATABASE_PORT: ${DATABASE_PORT:?set DATABASE_PORT}
DATABASE_NAME: ${DATABASE_NAME:?set DATABASE_NAME}
DATABASE_USER: ${DATABASE_USER:?set DATABASE_USER}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:?set DATABASE_PASSWORD}
ports:
- "${API_BIND_ADDRESS:?set API_BIND_ADDRESS}:${API_PORT:?set API_PORT}:8080"
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:?set POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER:?set POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U \"$${POSTGRES_USER}\" -d \"$${POSTGRES_DB}\""
]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
volumes:
postgres_data: