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:
33
server/Dockerfile
Normal file
33
server/Dockerfile
Normal file
@ -0,0 +1,33 @@
|
||||
FROM dart:stable AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pubspec.* ./
|
||||
RUN dart pub get
|
||||
|
||||
COPY . .
|
||||
RUN dart compile exe bin/server.dart -o build/server \
|
||||
&& dart compile exe bin/migrate.dart -o build/migrate
|
||||
|
||||
FROM debian:bookworm-slim AS runtime
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV PORT=8080
|
||||
ENV MIGRATE_ON_STARTUP=true
|
||||
|
||||
COPY --from=build /app/build/server /app/bin/server
|
||||
COPY --from=build /app/build/migrate /app/bin/migrate
|
||||
COPY migrations/ /app/migrations/
|
||||
COPY scripts/docker-entrypoint.sh /app/scripts/docker-entrypoint.sh
|
||||
|
||||
RUN chmod +x /app/bin/server /app/bin/migrate /app/scripts/docker-entrypoint.sh
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["/app/scripts/docker-entrypoint.sh"]
|
||||
CMD ["/app/bin/server"]
|
||||
Reference in New Issue
Block a user