3 Commits

Author SHA1 Message Date
WorkClub Automation 9304db2391 Fix: Add API_INTERNAL_URL to Dockerfile build stage
CI Pipeline / Backend Build & Test (push) Successful in 59s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 30s
CI Pipeline / Infrastructure Validation (push) Successful in 3s
Next.js rewrites are evaluated at build time, not runtime.
The API_INTERNAL_URL was set in K8s deployment but not during
the Docker build, causing fallback to localhost:5001.

- Added ENV API_INTERNAL_URL=http://workclub-api:8080
- This ensures Next.js rewrites point to internal K8s service
2026-03-21 14:13:37 +01:00
WorkClub Automation 1aea91da55 fix: Bind Next.js server to 0.0.0.0 for external access
The deployment was unreachable because the Next.js server was binding
to localhost:3000 (127.0.0.1) instead of 0.0.0.0, making it only
accessible inside the Docker container.

- Added HOSTNAME=0.0.0.0 to Dockerfile build and runtime stages
- Added HOSTNAME=0.0.0.0 to docker-compose.yml for nextjs service

This allows the server to accept connections from external hosts.
2026-03-20 13:29:21 +01:00
WorkClub Automation 6124557f11 infra(docker): add Dockerfiles for backend and frontend
Implements Tasks 23 & 24: Backend and Frontend Dockerfiles

Backend Dockerfiles:
- Dockerfile.dev: Development with dotnet watch hot reload
  - Base: sdk:10.0, installs dotnet-ef tool
  - Layer caching: csproj files copied before source
  - Entry: dotnet watch run with --no-restore
- Dockerfile: Production multi-stage build
  - Build stage: sdk:10.0, restore + build + publish
  - Runtime stage: aspnet:10.0-alpine (~110MB)
  - Health check: /health/live endpoint
  - Non-root: USER app (built-in)

Frontend Dockerfiles:
- Dockerfile.dev: Development with Bun hot reload
  - Base: node:22-alpine, installs Bun globally
  - Layer caching: package.json + bun.lock before source
  - Command: bun run dev
- Dockerfile: Production standalone 3-stage build
  - Deps stage: Install with --frozen-lockfile
  - Build stage: bun run build → standalone output
  - Runner stage: node:22-alpine with non-root nextjs user
  - Copies: .next/standalone, .next/static, public
  - Health check: Node.js HTTP GET to port 3000
  - Entry: node server.js (~240MB)

All Dockerfiles use layer caching optimization and security best practices.

Note: Docker build verification skipped (Docker daemon not running).
2026-03-03 20:59:20 +01:00