Cybersecurity-Projects/PROJECTS/beginner/canary-token-generator/backend
CarterPerez-dev 8b70bfbba9 chore(canary): merge backend compose into project root
Single project-root compose.yml + dev.compose.yml manage all services.

Production stack (compose.yml):
- nginx          public ingress on \${NGINX_HOST_PORT:-22784}:80
- canary         Go backend, NO host port (reachable only via nginx)
                 distroless/static:nonroot Dockerfile
                 healthcheck → /healthz, depends on postgres + redis
- postgres       postgres:18-alpine, no host port, named volume pgdata
- redis          redis:7-alpine, no host port, named volume redisdata
- (geolite vol)  read-only mount /data for GeoLite2-City.mmdb

Dev stack (dev.compose.yml):
- nginx          dev ingress on \${NGINX_HOST_PORT:-58495}:80
- frontend       Vite HMR on \${FRONTEND_HOST_PORT:-15723}:5173
- canary         Air hot-reload (canary.dev Dockerfile, bind-mounts ./backend)
                 OTel exports to jaeger:4317
- postgres       host port \${POSTGRES_DEV_PORT:-5447}:5432 for psql access
- redis          host port \${REDIS_DEV_PORT:-6022}:6379 for redis-cli access
- jaeger         UI 16686, OTLP gRPC 4317, OTLP HTTP 4318
- volumes        gocache + gomodcache speed up rebuilds

All randomized host ports preserved exactly:
  22784 (prod nginx), 58495 (dev nginx), 15723 (vite), 5447 (pg dev),
  6022 (redis dev), 16686/4317/4318 (jaeger).

Backend has no host port in production: nginx is the single entrypoint.
Cloudflare Tunnel sidecar terminates at nginx:80 via cloudflared.compose.yml.

backend/compose.yml + backend/dev.compose.yml deleted (merged here).

Validation:
- docker compose -f compose.yml config           — OK
- docker compose -f dev.compose.yml config       — OK
- docker compose -f compose.yml -f cloudflared.compose.yml config — OK
2026-05-10 05:23:55 -04:00
..
cmd/canary feat(canary): backend bootstrap — strip JWT/users, rename module, rewrite main 2026-05-10 05:22:08 -04:00
internal feat(canary): backend bootstrap — strip JWT/users, rename module, rewrite main 2026-05-10 05:22:08 -04:00
.air.toml feat(canary): backend bootstrap — strip JWT/users, rename module, rewrite main 2026-05-10 05:22:08 -04:00
.env.example feat(canary): backend bootstrap — strip JWT/users, rename module, rewrite main 2026-05-10 05:22:08 -04:00
.gitignore feat(canary): backend bootstrap — strip JWT/users, rename module, rewrite main 2026-05-10 05:22:08 -04:00
.golangci.yml feat(canary): backend bootstrap — strip JWT/users, rename module, rewrite main 2026-05-10 05:22:08 -04:00
Dockerfile feat(canary): backend bootstrap — strip JWT/users, rename module, rewrite main 2026-05-10 05:22:08 -04:00
Justfile feat(canary): backend bootstrap — strip JWT/users, rename module, rewrite main 2026-05-10 05:22:08 -04:00
config.yaml feat(canary): backend bootstrap — strip JWT/users, rename module, rewrite main 2026-05-10 05:22:08 -04:00
go.mod feat(canary): backend bootstrap — strip JWT/users, rename module, rewrite main 2026-05-10 05:22:08 -04:00
go.sum feat(canary): backend bootstrap — strip JWT/users, rename module, rewrite main 2026-05-10 05:22:08 -04:00