From ae8778b371dcbb91452db5931a14e300cd1d36fe Mon Sep 17 00:00:00 2001 From: "theo.gillet" Date: Wed, 25 Feb 2026 16:39:51 +0100 Subject: [PATCH] [CHORE]: added service metabase in docker compose --- docker-compose.yml | 23 +++++++++++++++++++++-- v6y-database/init-db.sh | 3 +++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 68f6e03d..8f081fc3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: v6y-database: image: postgres:18 @@ -181,5 +179,26 @@ services: timeout: 10s retries: 3 + v6y-metabase: + image: metabase/metabase + ports: + - "4000:4000" + environment: + - MB_DB_TYPE=postgres + - MB_DB_HOST=v6y-database + - MB_DB_PORT=5432 + - MB_DB_DBNAME=${PSQL_DB_NAME} + - MB_DB_USER=${PSQL_DB_USER} + - MB_DB_PASS=${PSQL_DB_PASSWORD} + - MB_JETTY_PORT=4000 + depends_on: + v6y-database: + condition: service_healthy + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:4000/api/health" ] + interval: 30s + timeout: 10s + retries: 3 + volumes: mono-node-modules: null diff --git a/v6y-database/init-db.sh b/v6y-database/init-db.sh index 2ed39af5..48fae148 100755 --- a/v6y-database/init-db.sh +++ b/v6y-database/init-db.sh @@ -24,6 +24,9 @@ if [ ! -f /var/lib/postgresql/data/.initialized ]; then psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "$sql" + echo "Creating metabase database..." + psql -U "$POSTGRES_USER" -c "CREATE DATABASE metabase OWNER $POSTGRES_USER;" || true + touch /var/lib/postgresql/data/.initialized echo "Database restore completed!" else