Commit Graph

10 Commits

Author SHA1 Message Date
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