Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
v6y-database:
image: postgres:18
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions v6y-database/init-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading