# Desarrollo local — Moraworld Imports # Por defecto levanta SOLO api + web (para que Coolify funcione out-of-the-box). # Para BD/Redis/MinIO locales: docker compose --profile storage up -d # # Uso: # pnpm docker:up # api + web (producción local) # pnpm docker:up --profile storage # + postgres + redis + minio services: api: build: context: . dockerfile: apps/api/Dockerfile container_name: moraworld-api restart: unless-stopped ports: - "3001:3001" environment: - NODE_ENV=production - PORT=3001 - DATABASE_URL=${DATABASE_URL} - REDIS_URL=${REDIS_URL} - JWT_SECRET=${JWT_SECRET} - JWT_REFRESH_SECRET=${JWT_REFRESH_SECRET} - AUDIT_HMAC_SECRET=${AUDIT_HMAC_SECRET} - CORS_ORIGINS=${CORS_ORIGINS} - S3_ENDPOINT=${S3_ENDPOINT} - S3_ACCESS_KEY=${S3_ACCESS_KEY} - S3_SECRET_KEY=${S3_SECRET_KEY} - S3_BUCKET=${S3_BUCKET} - S3_REGION=${S3_REGION} - S3_PUBLIC_URL=${S3_PUBLIC_URL} - STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET} healthcheck: test: ["CMD", "wget", "-qO-", "http://localhost:3001/api/health"] interval: 30s timeout: 5s retries: 3 start_period: 15s networks: - moraworld-network web: build: context: . dockerfile: apps/web/Dockerfile container_name: moraworld-web restart: unless-stopped ports: - "3002:3000" environment: - NODE_ENV=production - PORT=3000 - NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL} - NEXT_PUBLIC_WS_URL=${NEXT_PUBLIC_WS_URL} healthcheck: test: ["CMD", "wget", "-qO-", "http://localhost:3000/status"] interval: 30s timeout: 5s retries: 3 start_period: 15s networks: - moraworld-network # ─── Perfil "storage": BD, Redis, MinIO (solo desarrollo local) ─── postgres: image: postgres:16-alpine container_name: moraworld-postgres restart: unless-stopped ports: - "5432:5432" environment: POSTGRES_USER: moraworld POSTGRES_PASSWORD: moraworld_dev POSTGRES_DB: moraworld volumes: - moraworld_pg_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U moraworld -d moraworld"] interval: 5s timeout: 5s retries: 5 profiles: - storage redis: image: redis:7-alpine container_name: moraworld-redis restart: unless-stopped ports: - "6379:6379" volumes: - moraworld_redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 5 profiles: - storage minio: image: minio/minio:latest container_name: moraworld-minio restart: unless-stopped ports: - "9000:9000" - "9001:9001" environment: MINIO_ROOT_USER: minioadmin MINIO_ROOT_PASSWORD: minioadmin command: server /data --console-address ":9001" volumes: - moraworld_minio_data:/data profiles: - storage volumes: moraworld_pg_data: moraworld_redis_data: moraworld_minio_data: networks: moraworld-network: driver: bridge name: moraworld-network