mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:21:10 +02:00
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>
145 lines
4.2 KiB
YAML
145 lines
4.2 KiB
YAML
# Simplified staging config: mana-core-auth + chat-backend only
|
|
# Full config archived at: docker-compose.staging.full.yml
|
|
#
|
|
# To restore full config:
|
|
# cp docker-compose.staging.full.yml docker-compose.staging.yml
|
|
#
|
|
# To add more services back:
|
|
# 1. Copy the service block from docker-compose.staging.full.yml
|
|
# 2. Add corresponding health check in .github/workflows/cd-staging.yml
|
|
# 3. Add service to workflow_dispatch options in cd-staging.yml
|
|
|
|
services:
|
|
# ============================================
|
|
# Infrastructure Services
|
|
# ============================================
|
|
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: manacore-postgres-staging
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB:-manacore}
|
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- manacore-network
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: manacore-redis-staging
|
|
restart: unless-stopped
|
|
command: redis-server --requirepass ${REDIS_PASSWORD:-redis123}
|
|
volumes:
|
|
- redis_data:/data
|
|
ports:
|
|
- "6379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- manacore-network
|
|
|
|
# ============================================
|
|
# Backend Services
|
|
# ============================================
|
|
|
|
mana-core-auth:
|
|
image: ${DOCKER_REGISTRY:-ghcr.io/memo-2023}/mana-core-auth:${AUTH_VERSION:-latest}
|
|
container_name: mana-core-auth-staging
|
|
restart: unless-stopped
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
environment:
|
|
NODE_ENV: staging
|
|
PORT: 3001
|
|
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD}@postgres:5432/manacore_auth
|
|
REDIS_HOST: redis
|
|
REDIS_PORT: 6379
|
|
REDIS_PASSWORD: ${REDIS_PASSWORD:-redis123}
|
|
JWT_SECRET: ${JWT_SECRET}
|
|
JWT_PUBLIC_KEY: ${JWT_PUBLIC_KEY}
|
|
JWT_PRIVATE_KEY: ${JWT_PRIVATE_KEY}
|
|
ports:
|
|
- "3001:3001"
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3001/api/v1/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
networks:
|
|
- manacore-network
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
|
|
chat-backend:
|
|
image: ${DOCKER_REGISTRY:-ghcr.io/memo-2023}/chat-backend:${CHAT_VERSION:-latest}
|
|
container_name: chat-backend-staging
|
|
restart: unless-stopped
|
|
depends_on:
|
|
mana-core-auth:
|
|
condition: service_healthy
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
NODE_ENV: staging
|
|
PORT: 3002
|
|
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD}@postgres:5432/chat
|
|
MANA_CORE_AUTH_URL: http://mana-core-auth:3001
|
|
SUPABASE_URL: ${SUPABASE_URL}
|
|
SUPABASE_SERVICE_KEY: ${SUPABASE_SERVICE_ROLE_KEY}
|
|
AZURE_OPENAI_ENDPOINT: ${AZURE_OPENAI_ENDPOINT}
|
|
AZURE_OPENAI_API_KEY: ${AZURE_OPENAI_API_KEY}
|
|
AZURE_OPENAI_API_VERSION: ${AZURE_OPENAI_API_VERSION:-2024-12-01-preview}
|
|
ports:
|
|
- "3002:3002"
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3002/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
networks:
|
|
- manacore-network
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
|
|
# ============================================
|
|
# Networks
|
|
# ============================================
|
|
|
|
networks:
|
|
manacore-network:
|
|
driver: bridge
|
|
name: manacore-staging
|
|
|
|
# ============================================
|
|
# Volumes
|
|
# ============================================
|
|
|
|
volumes:
|
|
postgres_data:
|
|
name: manacore-postgres-staging
|
|
redis_data:
|
|
name: manacore-redis-staging
|