diff --git a/docker-compose.yml b/docker-compose.yml index 8038ed12..0999f41e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,6 @@ services: -c 'mkdir -p /export/adventureworks && minio server /export --console-address :9001' healthcheck: test: timeout 5s bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1 - start_period: 5s interval: 10s timeout: 5s retries: 2 @@ -54,6 +53,11 @@ services: - ./playground:/var/lib/playground image: "greenmask/greenmask:latest" working_dir: /var/lib/playground + environment: + PGPASSWORD: example + ORIGINAL_DB_NAME: "original" + TRANSFORMED_DB_NAME: "transformed" + DATABASE_HOST: "playground-db" depends_on: playground-dbs-filler: condition: service_completed_successfully @@ -68,6 +72,11 @@ services: build: dockerfile: docker/greenmask/Dockerfile context: ./ + environment: + PGPASSWORD: example + ORIGINAL_DB_NAME: "original" + TRANSFORMED_DB_NAME: "transformed" + DATABASE_HOST: "playground-db" depends_on: playground-dbs-filler: condition: service_completed_successfully diff --git a/playground/cleanup.sh b/playground/cleanup.sh index 94061098..072244bb 100755 --- a/playground/cleanup.sh +++ b/playground/cleanup.sh @@ -1,6 +1,6 @@ #!/bin/bash -if psql -lqt -p 5432 -h db -U postgres | cut -d \| -f 1 | grep -qw $TRANSFORMED_DB_NAME; then - psql -p 5432 -h db -U postgres -c "DROP DATABASE $TRANSFORMED_DB_NAME;" - psql -p 5432 -h db -U postgres -c "CREATE DATABASE $TRANSFORMED_DB_NAME;" +if psql -lqt -p 5432 -h $DATABASE_HOST -U postgres | cut -d \| -f 1 | grep -qw $TRANSFORMED_DB_NAME; then + psql -p 5432 -h $DATABASE_HOST -U postgres -c "DROP DATABASE $TRANSFORMED_DB_NAME;" + psql -p 5432 -h $DATABASE_HOST -U postgres -c "CREATE DATABASE $TRANSFORMED_DB_NAME;" fi