feat(docker): single application image for the VPS (#19) #40

Merged
Reliodas merged 1 commit from feat/19-single-docker-image into develop 2026-06-24 14:31:15 +00:00
Owner

Closes #19.

Remplace le duo nginx + node par une seule image Node/Fastify servant tout sur la même origine.

Changements

  • Fastify sert client/dist via @fastify/static avec fallback Vue Router, aux côtés de Socket.IO et /health sur le port 3000 (même origine) → le io() même-origine du client fonctionne sans proxy.
  • Dockerfile racine multi-stage : build shared + client + server, runtime slim (deps prod uniquement), utilisateur non privilégié node, HEALTHCHECK sur /health.
  • docker-compose.yml réduit à un service ; suppression des anciens Dockerfiles et de nginx.conf.
  • Smoke test (scripts/smoke.ts, npm run smoke) : /health, route statique, fallback SPA, websocket — câblé en CI ; les deux builds Kaniko deviennent un seul build-app.
  • Doc : déploiement image unique + reverse proxy TLS externe (Caddy/Traefik/nginx) dans README et Implémentation.md.

Tests

  • Smoke test vert en local (health, static, fallback, websocket) ; node:test 191/1 skip, Jest 13 ; typecheck + builds OK.

Critères d'acceptation

  • Dockerfile multi-stage à la racine
  • Build client pendant l'étape de build
  • Deps prod serveur avec lockfile (npm ci)
  • Fastify sert le client compilé + fallback Vue Router
  • Socket.IO et /health sur le même port
  • Utilisateur non privilégié + healthcheck
  • Docker Compose et doc adaptés (un service)
  • Reverse proxy TLS externe documenté
  • Smoke test CI (route statique, /health, WebSocket)

🤖 Generated with Claude Code

Closes #19. Remplace le duo nginx + node par **une seule image Node/Fastify** servant tout sur la même origine. ## Changements - Fastify sert `client/dist` via `@fastify/static` avec fallback Vue Router, aux côtés de Socket.IO et `/health` sur le port 3000 (même origine) → le `io()` même-origine du client fonctionne sans proxy. - **Dockerfile racine multi-stage** : build shared + client + server, runtime slim (deps prod uniquement), utilisateur non privilégié `node`, `HEALTHCHECK` sur `/health`. - `docker-compose.yml` réduit à un service ; suppression des anciens Dockerfiles et de `nginx.conf`. - **Smoke test** (`scripts/smoke.ts`, `npm run smoke`) : `/health`, route statique, fallback SPA, websocket — câblé en CI ; les deux builds Kaniko deviennent un seul `build-app`. - Doc : déploiement image unique + reverse proxy TLS externe (Caddy/Traefik/nginx) dans README et Implémentation.md. ## Tests - Smoke test vert en local (health, static, fallback, websocket) ; node:test 191/1 skip, Jest 13 ; typecheck + builds OK. ## Critères d'acceptation - [x] Dockerfile multi-stage à la racine - [x] Build client pendant l'étape de build - [x] Deps prod serveur avec lockfile (`npm ci`) - [x] Fastify sert le client compilé + fallback Vue Router - [x] Socket.IO et /health sur le même port - [x] Utilisateur non privilégié + healthcheck - [x] Docker Compose et doc adaptés (un service) - [x] Reverse proxy TLS externe documenté - [x] Smoke test CI (route statique, /health, WebSocket) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(docker): single application image for VPS deployment
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
888181c4f4
Replace the two-container (nginx + node) setup with one Node/Fastify image that
serves everything on one origin (#19).

- Fastify serves the built client via @fastify/static with a Vue Router
  fallback, alongside Socket.IO and /health on port 3000 (same origin), so the
  client's same-origin io() works without a proxy.
- Add a root multi-stage Dockerfile: builds shared, client and server, then a
  slim runtime with prod-only deps, running as the unprivileged `node` user with
  a /health HEALTHCHECK.
- docker-compose collapses to a single service; remove the old per-service
  Dockerfiles and nginx.conf.
- Add a smoke test (scripts/smoke.ts, npm run smoke) checking /health, the
  static client, the SPA fallback and a websocket; wire it into CI and replace
  the two Kaniko image builds with one.
- Document the single-image deployment and the external TLS reverse proxy
  (Caddy/Traefik/nginx) in README and Implémentation.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reliodas merged commit ac8383a902 into develop 2026-06-24 14:31:15 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jeux/le-grand-concours#40
No description provided.