From 9d7871dd53d0c24cdcca63336470d59f392ef936 Mon Sep 17 00:00:00 2001 From: brunomiguelpinto Date: Mon, 29 Jul 2024 13:32:33 +0100 Subject: [PATCH] feat: Dedicated Migration Container (#383) --- docker-compose.dev.yml | 14 ++++++++++++++ docker-compose.yml | 15 +++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 8c46091..c1227ce 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -376,3 +376,17 @@ services: ports: - 9000:9000 - 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} diff --git a/docker-compose.yml b/docker-compose.yml index fc39e42..2b6cc57 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -290,3 +290,18 @@ services: pdf: 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}