panels-origin/docker-compose.local.yml
Cursor Agent a45675b6a6
deploy: Liquibase automático en cada deploy (job migrate)
Coolify usa docker-compose.yml: migrate aplica schema (!dev) y la API
espera a que termine. Postgres/Redis locales quedan en docker-compose.local.yml.

Co-authored-by: alberto.martinez <alberto.martinez@mrdev.mx>
2026-09-03 04:54:15 +00:00

80 lines
2.9 KiB
YAML

# Desarrollo local: Postgres + Redis en compose, provision y seed `dev`.
# Uso: docker compose -f docker-compose.yml -f docker-compose.local.yml up --build
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_PASSWORD: ${POSTGRES_SUPERUSER_PASSWORD:?define POSTGRES_SUPERUSER_PASSWORD}
volumes:
- postgres-data:/var/lib/postgresql/data
expose:
- "5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
restart: unless-stopped
expose:
- "6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 10
provision:
build:
context: .
dockerfile: Dockerfile.provision
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
PGHOST: postgres
PGPASSWORD: ${POSTGRES_SUPERUSER_PASSWORD:?}
PLATFORM_OWNER_PASSWORD: ${PLATFORM_OWNER_PASSWORD:?}
PLATFORM_APP_PASSWORD: ${PLATFORM_APP_PASSWORD:?}
IAM_OWNER_PASSWORD: ${IAM_OWNER_PASSWORD:?}
IAM_APP_PASSWORD: ${IAM_APP_PASSWORD:?}
CORE_OWNER_PASSWORD: ${CORE_OWNER_PASSWORD:?}
CORE_APP_PASSWORD: ${CORE_APP_PASSWORD:?}
REDIS_ADMIN_URL: redis://redis:6379
IAM_REDIS_PASSWORD: ${IAM_REDIS_PASSWORD:?}
CORE_REDIS_PASSWORD: ${CORE_REDIS_PASSWORD:?}
command:
- -c
- "./db/provision/docker-provision.sh && ./db/provision/05-redis-acl.sh"
migrate:
depends_on:
provision:
condition: service_completed_successfully
environment:
DATABASE_URL_PLATFORM_OWNER: postgresql://panels_platform_owner:${PLATFORM_OWNER_PASSWORD:?}@postgres:5432/panels_platform
DATABASE_URL_IAM_OWNER: postgresql://panels_iam_owner:${IAM_OWNER_PASSWORD:?}@postgres:5432/panels_product
DATABASE_URL_CORE_OWNER: postgresql://panels_core_owner:${CORE_OWNER_PASSWORD:?}@postgres:5432/panels_product
command: ["all", "--context-filter=dev"]
api:
depends_on:
redis:
condition: service_healthy
environment:
DENO_ENV: development
DATABASE_URL_PLATFORM: postgresql://panels_platform_app:${PLATFORM_APP_PASSWORD:?}@postgres:5432/panels_platform
DATABASE_URL_IAM: postgresql://panels_iam_app:${IAM_APP_PASSWORD:?}@postgres:5432/panels_product
DATABASE_URL_CORE: postgresql://panels_core_app:${CORE_APP_PASSWORD:?}@postgres:5432/panels_product
DATABASE_URL_IAM_OWNER: postgresql://panels_iam_owner:${IAM_OWNER_PASSWORD:?}@postgres:5432/panels_product
DATABASE_URL_CORE_OWNER: postgresql://panels_core_owner:${CORE_OWNER_PASSWORD:?}@postgres:5432/panels_product
REDIS_URL_IAM: redis://panels_iam_redis:${IAM_REDIS_PASSWORD:?}@redis:6379
REDIS_URL_CORE: redis://panels_core_redis:${CORE_REDIS_PASSWORD:?}@redis:6379
volumes:
postgres-data: