Commit Graph
7 Commits
Author SHA1 Message Date
asepharyana c5a9371e71 fix(infra): nginx upstream DNS staleness — 502 after backend restart
- Replace upstream blocks with variable-based proxy_pass + Docker DNS
  resolver (127.0.0.11) so nginx resolves hostnames dynamically on
  each request instead of caching at startup only.
- Add explicit 'docker compose restart proxy' in CI deploy step
  (belt-and-suspenders: also forces nginx restart after deploy).
- Remove no-op sed commands from CI (docker-compose.yml already uses
  GitLab registry, no ghcr.io replacements needed).

Root cause: docker compose up -d only recreates containers whose image
changed. When backend container is recreated (new Docker IP), nginx
still caches the old IP → 502 Bad Gateway on /api/*
2026-07-02 04:22:16 +07:00
asepharyana 91e14abbda Revert "fix: update nginx for Astro SSG — /_astro/ cache, remove SPA fallback"
This reverts commit 918e45f9da.
2026-07-02 03:54:44 +07:00
asepharyana 918e45f9da fix: update nginx for Astro SSG — /_astro/ cache, remove SPA fallback 2026-07-02 03:42:56 +07:00
MythEclipseandClaude Opus 4.8 <noreply@anthropic.com d036fbf568 opt(deploy): multi-stage frontend (node→nginx), non-root user, healthchecks, resource limits
Frontend:
- Multi-stage build: builder (node:22-alpine) → runner (nginx:alpine)
  replaces vite preview (400MB RAM) with nginx static serving (<20MB RAM)
- New nginx-frontend.conf with gzip + long-term asset cache + SPA fallback

Backend & Discord Gateway:
- Add non-root user (USER app) for container security
- chown app files to avoid permission issues
- Add HEALTHCHECK: backend via /api/health, gateway via kill -0 1

Docker Compose:
- Remove unnecessary backend→gateway depends_on
- Add deploy.resources.limits.memory for all services
- Add healthchecks for all services

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com
2026-06-08 17:51:29 +07:00
MythEclipseandClaude Opus 4.8 bf0d0090c9 fix(ci): use SCP to copy docker-compose and nginx from repo instead of hardcoded cat
- Add proxy to build matrix
- Replace heredoc docker-compose generation with appleboy/scp-action
- Fix nginx upstream backend port to 3000 (matches prod WEBSERVER_PORT)
- Copy docker-compose.yml and nginx.conf from repo via SCP staging

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 09:03:13 +07:00
MythEclipseandClaude Opus 4.8 cbe63809dd fix(infra): use ^~ prefix location for /api and /ws to match without trailing slash
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 08:51:57 +07:00
MythEclipseandClaude Opus 4.8 2b8d1ac703 feat(infra): replace traefik path routing with nginx reverse proxy
- Add nginx service with /api, /ws, and / location routing
- Move traefik labels to proxy service only (port 80)
- Remove traefik labels from backend and frontend services
- Backend routes to :3001 via nginx upstream
- WebSocket upgrade enabled for /ws path

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 08:36:34 +07:00