15 Commits

Author SHA1 Message Date
Ho Ngoc Hai
416d1a5959 fix(web): call next binary directly instead of npx in Dockerfile
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 8s
CI / E2E Tests (push) Has been skipped
CI / AI Services (Python) — Smoke (push) Failing after 5s
CodeQL Analysis / CodeQL (javascript-typescript) (push) Failing after 1m4s
Deploy / Build API Image (push) Failing after 15s
Deploy / Build Web Image (push) Failing after 6s
Deploy / Build AI Services Image (push) Failing after 7s
E2E Tests / Playwright E2E (push) Failing after 11s
Security Scanning / Dependency Audit (pnpm) (push) Failing after 4s
Security Scanning / Trivy Scan — API Image (push) Failing after 48s
Security Scanning / Trivy Scan — Web Image (push) Failing after 37s
Security Scanning / Trivy Scan — AI Services Image (push) Failing after 1m40s
Security Scanning / Trivy Filesystem Scan (push) Failing after 1m48s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Security Scanning / Security Gate (push) Failing after 1s
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
The hoisted node_modules layout (set in deps stage `.npmrc` with
`node-linker=hoisted`) puts `next` at `/app/node_modules/next` only —
`apps/web/node_modules/next` doesn't exist. The previous
`cd apps/web && npx next build` failed with:

  Cannot find module '/app/apps/web/node_modules/next/dist/bin/next'

because `npx` resolves binaries against the cwd subtree and doesn't
walk up. Switching to the explicit binary path
`/app/node_modules/.bin/next build` makes the build reproducible
in the goodgo Docker image.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 13:49:51 +07:00
Ho Ngoc Hai
625b5b24fd fix: Web NEXT_PUBLIC_API_URL — add /api/v1 path suffix
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 7s
CI / E2E Tests (push) Has been skipped
Deploy / Build API Image (push) Failing after 11s
Deploy / Build Web Image (push) Failing after 12s
Deploy / Build AI Services Image (push) Failing after 12s
E2E Tests / Playwright E2E (push) Failing after 13s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
api-client.ts uses NEXT_PUBLIC_API_URL as base URL for all fetch calls.
Without /api/v1, requests go to /listings instead of /api/v1/listings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 00:56:01 +07:00
Ho Ngoc Hai
b9ad280192 fix: Web Dockerfile — set NEXT_PUBLIC_API_URL at build time
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 11s
CI / E2E Tests (push) Has been skipped
Deploy / Build API Image (push) Failing after 16s
Deploy / Build Web Image (push) Failing after 7s
Deploy / Build AI Services Image (push) Failing after 8s
E2E Tests / Playwright E2E (push) Failing after 10s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
NEXT_PUBLIC_* env vars are inlined into the JS bundle during next build.
Without setting them as build ARGs, the client-side apiClient falls back
to localhost:3001 which doesn't work in production.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 19:54:56 +07:00
Ho Ngoc Hai
35b64ae5f5 fix: Web Dockerfile — remove invalid COPY with shell redirect
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 20s
CI / E2E Tests (push) Has been skipped
Deploy / Build API Image (push) Failing after 21s
Deploy / Build Web Image (push) Failing after 10s
Deploy / Build AI Services Image (push) Failing after 13s
E2E Tests / Playwright E2E (push) Failing after 17s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
Dockerfile COPY doesn't support shell redirects (2>/dev/null || true).
With node-linker=hoisted, all deps are in root node_modules anyway.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 14:24:58 +07:00
Ho Ngoc Hai
09fdc5ccbe fix: Web Dockerfile — use node-linker=hoisted for flat node_modules
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 11s
CI / E2E Tests (push) Has been skipped
Deploy / Build API Image (push) Failing after 16s
Deploy / Build Web Image (push) Failing after 10s
Deploy / Build AI Services Image (push) Failing after 9s
E2E Tests / Playwright E2E (push) Failing after 12s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
pnpm default mode creates symlinks in node_modules that break when
copied between Docker stages. Using node-linker=hoisted makes pnpm
create flat node_modules (like npm), so Next.js standalone output
contains real files instead of broken symlinks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 13:35:15 +07:00
Ho Ngoc Hai
ffdedc9841 fix: API+Web Dockerfiles — mock husky, fresh prod deps install
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 8s
Deploy / Build AI Services Image (push) Failing after 11s
E2E Tests / Playwright E2E (push) Failing after 22s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
CI / E2E Tests (push) Has been skipped
Deploy / Build API Image (push) Failing after 19s
Deploy / Build Web Image (push) Failing after 12s
Deploy / Deploy to Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
API: Remove --ignore-scripts, mock husky binary instead so postinstall
scripts (like prisma) run correctly while avoiding git hook errors.

Web: Remove broken flatten stage entirely. Install fresh prod deps in
production stage (same approach as API) to avoid pnpm symlink issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 12:49:08 +07:00
Ho Ngoc Hai
1554161ab4 fix: Web Dockerfile — rebuild pnpm symlinks in flatten stage
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 14s
CI / E2E Tests (push) Has been skipped
Deploy / Build Web Image (push) Failing after 18s
Deploy / Build AI Services Image (push) Failing after 12s
E2E Tests / Playwright E2E (push) Failing after 12s
Deploy / Build API Image (push) Failing after 14m0s
Deploy / Deploy to Staging (push) Has been cancelled
Deploy / Smoke Test Staging (push) Has been cancelled
Deploy / Rollback Staging (push) Has been cancelled
Deploy / Deploy to Production (push) Has been cancelled
Deploy / Smoke Test Production (push) Has been cancelled
Deploy / Rollback Production (push) Has been cancelled
pnpm standalone output has top-level symlinks pointing outside the dir.
Copy .pnpm store (real files), then find+link each package correctly.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
2026-04-14 02:04:58 +07:00
Ho Ngoc Hai
b2a908983a fix: Web Dockerfile — use cp -rL to dereference pnpm symlinks
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 15s
CI / E2E Tests (push) Has been skipped
Deploy / Build API Image (push) Failing after 20s
Deploy / Build Web Image (push) Failing after 10s
E2E Tests / Playwright E2E (push) Failing after 18s
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
Deploy / Build AI Services Image (push) Failing after 10s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
pnpm standalone output contains symlinks in node_modules/.
Docker COPY preserves symlinks as symlinks (broken in final image).
Use cp -rL in flatten stage to resolve them to real files.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
2026-04-14 01:26:15 +07:00
Ho Ngoc Hai
25c05c408a fix: Web Dockerfile — add flatten stage for pnpm standalone structure
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 9s
CI / E2E Tests (push) Has been skipped
Deploy / Build API Image (push) Failing after 14s
Deploy / Build Web Image (push) Failing after 11s
Deploy / Build AI Services Image (push) Failing after 10s
E2E Tests / Playwright E2E (push) Failing after 15s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
pnpm standalone output has nested .pnpm structure with symlinks.
Add intermediate flatten stage: copy full standalone dir, then
reorganize node_modules + apps/web/* into flat /app layout.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
2026-04-14 00:51:45 +07:00
Ho Ngoc Hai
4418d60c2b fix: Web standalone — set outputFileTracingRoot to repo root
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 22s
CI / E2E Tests (push) Has been skipped
Deploy / Build AI Services Image (push) Failing after 14s
E2E Tests / Playwright E2E (push) Failing after 20s
Deploy / Build API Image (push) Failing after 19s
Deploy / Build Web Image (push) Failing after 12s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
In monorepo, Next.js standalone creates symlinks instead of real files.
Setting outputFileTracingRoot to repo root produces self-contained output.
Dockerfile updated to copy from correct standalone structure.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
2026-04-14 00:19:48 +07:00
Ho Ngoc Hai
58781235f8 fix: Web Dockerfile — use standalone root directly, not apps/web subdir
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 7s
CI / E2E Tests (push) Has been skipped
Deploy / Build API Image (push) Failing after 10s
Deploy / Build Web Image (push) Failing after 9s
Deploy / Build AI Services Image (push) Failing after 9s
E2E Tests / Playwright E2E (push) Failing after 12s
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Next.js standalone output from `cd apps/web && next build` puts
server.js + node_modules at the standalone root, not in apps/web/.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
2026-04-13 23:51:13 +07:00
Ho Ngoc Hai
1c3dd305b8 fix: all 3 Dockerfiles — Prisma copy, standalone paths, maturin PATH
Some checks failed
CI / E2E Tests (push) Has been skipped
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 20s
Deploy / Build API Image (push) Failing after 27s
Deploy / Build Web Image (push) Failing after 17s
Deploy / Build AI Services Image (push) Failing after 20s
E2E Tests / Playwright E2E (push) Failing after 22s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
- API: copy .prisma + @prisma into pruned node_modules, restore dist/prisma COPY
- Web: fix standalone paths for monorepo (node_modules + apps/web/server.js)
- AI: source cargo env in same RUN layer, wrap fallback pip install in subshell

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
2026-04-13 16:23:51 +07:00
Ho Ngoc Hai
39bb6bc911 fix: Web Dockerfile handle empty public dir, add .gitkeep
Some checks failed
CI / E2E Tests (push) Has been skipped
Deploy / Build API Image (push) Failing after 12s
Deploy / Build AI Services Image (push) Failing after 13s
Deploy / Deploy to Staging (push) Has been skipped
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 11s
Deploy / Build Web Image (push) Failing after 12s
E2E Tests / Playwright E2E (push) Failing after 9s
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
- Reorder COPY to create public dir first (mkdir -p)
- Copy standalone + static before public (which may be empty)
- Add .gitkeep so Git tracks empty public directory

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
2026-04-13 15:49:05 +07:00
Ho Ngoc Hai
767afb56d5 fix(docker): harden production deployment config for all services
- Add resource limits (memory/CPU) and reservations for all services
- Add security hardening: read_only, no-new-privileges, tmpfs for temp dirs
- Add missing prod services: loki, promtail, pg-backup from dev compose
- Fix API healthcheck to include catch() for proper exit codes
- Add json-file logging driver with rotation limits across all services
- Remove exposed PostgreSQL port in prod (internal only)
- Add shm_size for PostgreSQL shared memory
- Add non-root user (appuser) to AI services Dockerfile
- Add --chown=node:node to COPY directives in API/Web Dockerfiles
- Harden .dockerignore: exclude IDE files, OS files, docker-compose files
- Fix Redis URL to include password authentication
- Add JWT_REFRESH_SECRET to API environment
- Add Grafana dependency on Loki for log datasource

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-08 13:44:44 +07:00
Ho Ngoc Hai
7c9f682046 feat(deploy): add production Dockerfiles and CI/CD pipeline
- Multi-stage Dockerfile for apps/api (NestJS) and apps/web (Next.js standalone)
- Production docker-compose.prod.yml with all services, health checks, and security
- Real deploy.yml pipeline: build → push to GHCR → deploy staging/production
- .dockerignore for optimized build context
- Enable Next.js standalone output mode

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-08 04:03:27 +07:00