🚀 ci(picture): add picture app to CI/CD deployment pipeline

- Add picture-backend and picture-web to CI Docker build matrix
- Add picture services to staging deployment workflow
- Add picture-backend to production deployment workflow
- Create Dockerfile and docker-entrypoint.sh for picture-web
- Fix picture-backend Dockerfile port (3003→3006) and health endpoint
- Add picture routes to Caddyfile.staging
- Add REPLICATE_API_TOKEN and MANA_CORE_SERVICE_KEY env vars
This commit is contained in:
Wuesteon 2025-12-17 18:47:42 +01:00
parent 74654e652a
commit dcdc15f154
8 changed files with 285 additions and 2 deletions

View file

@ -22,6 +22,7 @@ on:
- manadeck-backend
- nutriphi-backend
- news-api
- picture-backend
environment:
description: 'Deployment environment'
required: true
@ -269,7 +270,7 @@ jobs:
if [ "$SERVICE" == "all" ]; then
# Rolling update for all services
for service in mana-core-auth maerchenzauber-backend chat-backend manadeck-backend nutriphi-backend news-api; do
for service in mana-core-auth maerchenzauber-backend chat-backend manadeck-backend nutriphi-backend news-api picture-backend; do
echo "Deploying \$service..."
docker compose up -d --no-deps --scale \$service=2 \$service
sleep 10

View file

@ -31,6 +31,8 @@ on:
- calendar-web
- clock-backend
- clock-web
- picture-backend
- picture-web
workflow_call:
permissions:
@ -138,6 +140,12 @@ jobs:
S3_SECRET_KEY=${{ secrets.S3_SECRET_KEY }}
MANACORE_STORAGE_PUBLIC_URL=${{ secrets.MANACORE_STORAGE_PUBLIC_URL }}
# Replicate API (for Picture app AI image generation)
REPLICATE_API_TOKEN=${{ secrets.REPLICATE_API_TOKEN }}
# Mana Core Service Key (for credit system)
MANA_CORE_SERVICE_KEY=${{ secrets.MANA_CORE_SERVICE_KEY }}
# Environment
NODE_ENV=staging
EOF
@ -217,6 +225,9 @@ jobs:
# Create clock database (for clock-backend service)
docker compose exec -T postgres psql -U postgres -c "CREATE DATABASE clock;" 2>/dev/null || echo "clock database already exists"
# Create picture database (for picture-backend service)
docker compose exec -T postgres psql -U postgres -c "CREATE DATABASE picture;" 2>/dev/null || echo "picture database already exists"
echo "✅ Databases ready"
EOF
@ -349,6 +360,8 @@ jobs:
check_health calendar-web http://localhost:5186/health || exit 1
check_health clock-backend http://localhost:3017/api/v1/health || exit 1
check_health clock-web http://localhost:5187/health || exit 1
check_health picture-backend http://localhost:3006/api/v1/health || exit 1
check_health picture-web http://localhost:5175/health || exit 1
echo ""
echo "✅ All health checks passed!"

View file

@ -93,6 +93,8 @@ jobs:
- { name: 'calendar-web', path: 'apps/calendar/apps/web', port: '5186' }
- { name: 'clock-backend', path: 'apps/clock/apps/backend', port: '3017' }
- { name: 'clock-web', path: 'apps/clock/apps/web', port: '5187' }
- { name: 'picture-backend', path: 'apps/picture/apps/backend', port: '3006' }
- { name: 'picture-web', path: 'apps/picture/apps/web', port: '5175' }
fail-fast: false
steps:
- name: Checkout code