feat: Dedicated Migration Container (#383)

This commit is contained in:
brunomiguelpinto 2024-07-29 13:32:33 +01:00 committed by GitHub
parent 37420ee641
commit 9d7871dd53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 29 additions and 0 deletions

View File

@ -376,3 +376,17 @@ services:
ports: ports:
- 9000:9000 - 9000:9000
- 8123:8123 - 8123:8123
migrate:
container_name: lago-migrate_dev
image: api_dev
depends_on:
- db
command: ["./scripts/start.migrate.dev.sh"]
build:
context: ./api
dockerfile: $LAGO_PATH/api/Dockerfile.dev
volumes:
- $LAGO_PATH/api:/app:delegated
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER:-lago}:${POSTGRES_PASSWORD:-changeme}@db:5432/${POSTGRES_DB:-lago}

View File

@ -290,3 +290,18 @@ services:
pdf: pdf:
image: getlago/lago-gotenberg:7.8.2 image: getlago/lago-gotenberg:7.8.2
migrate:
container_name: lago-migrate
image: getlago/api:v1.8.1
depends_on:
- db
command: ["./scripts/start.migrate.sh"]
volumes:
- lago_storage_data:/app/storage
environment:
- RAILS_ENV=production
- SECRET_KEY_BASE=${SECRET_KEY_BASE:-your-secret-key-base-hex-64}
- RSA_PRIVATE_KEY=${LAGO_RSA_PRIVATE_KEY} # Should be base64 encoded
- LAGO_RSA_PRIVATE_KEY=${LAGO_RSA_PRIVATE_KEY} # Should be base64 encoded
- DATABASE_URL=postgresql://${POSTGRES_USER:-lago}:${POSTGRES_PASSWORD:-changeme}@${POSTGRES_HOST:-db}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-lago}?search_path=${POSTGRES_SCHEMA:-public}