Commit graph

12 commits

Author SHA1 Message Date
Wuesteon
4398fbc29b fix(manacore-web,todo-web): use runtime URLs for backend API services
- manacore-web: Update todo, calendar, contacts service files to use
  runtime URLs from window instead of import.meta.env (baked at build time)
- manacore-web: Add backend URL env vars to docker-compose.staging.yml
- manacore-web: Fix fallback ports (todo: 3017→3018, calendar: 3014→3016)
- todo-web: Update API client to use runtime URL from window

This enables Docker containers to use runtime-injected URLs instead of
build-time environment variables.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 22:03:12 +01:00
Wuesteon
e02e2b37b1 fix(staging): add all web app origins to mana-core-auth CORS
Added CORS origins for all staging web apps:
- manacore-web: 5173
- calendar-web: 5186
- clock-web: 5187
- todo-web: 5188

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 21:28:06 +01:00
Wuesteon
5e0b5a8e7a 🚀 ci: add Docker deployment for Manacore, Todo, Calendar, and Clock apps
Add complete Docker deployment infrastructure for 4 new applications:
- Dockerfiles for backend (NestJS) and web (SvelteKit) apps
- docker-entrypoint.sh scripts with PostgreSQL wait and schema push
- Updated docker-compose.staging.yml with 7 new services
- Updated CI/CD workflows with build matrix and health checks
2025-12-08 16:04:50 +01:00
Wuesteon
00281a86d3 fix(staging): add CORS_ORIGINS to mana-core-auth
Allow cross-origin requests from chat-web (port 3000) and chat-backend (port 3002)
to mana-core-auth (port 3001) on staging server.

Without this, browser requests from chat-web to mana-core-auth are blocked
by CORS policy since they're on different ports (3000 vs 3001).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 03:56:30 +01:00
Wuesteon
44608074fc fix(chat-web): inject runtime env vars for client-side auth
Problem: Browser was calling localhost:3001 instead of staging server IP
because environment variables from Docker aren't available client-side.

Solution:
1. Add PUBLIC_*_CLIENT env vars to docker-compose.staging.yml for browser URLs
2. Inject these into window.__PUBLIC_*__ via hooks.server.ts transformPageChunk
3. Auth store reads from window variable for client-side requests

This pattern properly handles:
- SSR: Uses Docker internal URLs (http://mana-core-auth:3001)
- Client: Uses public URLs (http://46.224.108.214:3001)
- Local dev: Falls back to localhost

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 03:38:53 +01:00
Wuesteon
4a56c888b0 fix(staging): correct chat-backend health check path to /api/v1/health
The chat-backend NestJS health endpoint is at /api/v1/health, not /api/health.
This was causing the container to be marked as unhealthy, preventing chat-web
from starting due to its depends_on condition.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 03:32:22 +01:00
Wuesteon
714298f7c8 feat(chat-web): add Docker deployment for chat frontend
- Add @sveltejs/adapter-node for server-side rendering
- Create Dockerfile for chat web SvelteKit app
- Add /health endpoint for container health checks
- Add chat-web service to docker-compose.staging.yml
- Update CI/CD workflow with chat-web health check

The chat app now deploys with both backend and web frontend:
- mana-core-auth (port 3001) - central auth
- chat-backend (port 3002) - API
- chat-web (port 3000) - web frontend

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 02:10:32 +01:00
Wuesteon
80f80053f3 refactor(staging): simplify CI/CD to mana-core-auth + chat-backend only
Archived full staging config for future restoration:
- docker-compose.staging.full.yml (includes manadeck, nginx)
- .github/workflows/cd-staging.full.yml (includes all health checks)

Simplified staging deployment:
- Only deploys postgres, redis, mana-core-auth, chat-backend
- Added database creation step for manacore_auth and chat DBs
- Faster iteration for testing central auth integration

To restore full config:
  cp docker-compose.staging.full.yml docker-compose.staging.yml
  cp .github/workflows/cd-staging.full.yml .github/workflows/cd-staging.yml

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 01:33:01 +01:00
Wuesteon
cf2b6aaa2b 🐛 fix(cd): fix postgres startup and health check issues in staging
Fixes two critical deployment issues:

1. Postgres Container Startup Failure:
   - Remove missing init.sql volume mount that caused postgres to fail
   - Postgres was trying to mount ./docker/postgres/init.sql which doesn't exist
   - Added REDIS_PASSWORD environment variable

2. Health Check SSH Issues:
   - Consolidated health checks into single SSH session
   - Increased wait time from 30s to 60s for services to fully initialize
   - Improved health check output with clear status messages
   - Added container status logging for debugging

3. Docker Compose Improvements:
   - Remove obsolete 'version: 3.9' field (deprecated in Compose v2)
   - Increase initial startup wait from 10s to 15s

Changes to docker-compose.staging.yml:
- Removed non-existent init.sql volume mount from postgres
- Removed obsolete version field

Changes to .github/workflows/cd-staging.yml:
- Added REDIS_PASSWORD to environment variables
- Consolidated health checks into single SSH session (fixes "ssh: command not found")
- Increased wait times for service initialization
- Improved logging and error messages

This should fix the "dependency failed to start: container manacore-postgres-staging is unhealthy" error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 04:21:15 +01:00
Wuesteon
f7986bc1a7 🐛 fix(cd): fix staging deployment registry authentication and missing images
Changes to .github/workflows/cd-staging.yml:
- Add Docker login step for GitHub Container Registry (ghcr.io)
- Add permissions for packages:read
- Update service deployment options to only include services with Dockerfiles
- Update health checks to match deployed services

Changes to docker-compose.staging.yml:
- Comment out services without Dockerfiles:
  - maerchenzauber-backend (no Dockerfile yet)
  - nutriphi-backend (no Dockerfile yet)
  - news-api (no Dockerfile yet)
- Keep only services with Docker images:
  - mana-core-auth 
  - chat-backend 
  - manadeck-backend 
- Update nginx dependencies to remove disabled services

This fixes the "error from registry: denied" error that was preventing
staging deployments. The deployment was trying to pull Docker images
that were never built because those services don't have Dockerfiles.

Now only services with actual Docker images will be deployed to staging.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 03:22:07 +01:00
Wuesteon
6c9e8972a7 fix: update docker registry to ghcr.io/memo-2023 2025-12-03 01:46:16 +01:00
Wuesteon
74dc6892ab first implementation 2025-11-27 17:26:18 +01:00