From d5ef94df1845f1c79228c026bf5616f6685153d4 Mon Sep 17 00:00:00 2001 From: Jaroslav Beran Date: Thu, 1 Feb 2024 21:29:16 +0100 Subject: [PATCH] Docker compose - db host fix --- docker-compose/create-schema.sh | 7 ++++--- docker-compose/svjis-dev.yml | 2 ++ docker-compose/svjis-prod.yml | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docker-compose/create-schema.sh b/docker-compose/create-schema.sh index 8def6b4..d9bebe2 100644 --- a/docker-compose/create-schema.sh +++ b/docker-compose/create-schema.sh @@ -1,10 +1,11 @@ USER=sysdba PASSWORD=change-it -HOST=svjis_db DATABASE=SVJIS_PRODUCTION -/usr/local/firebird/bin/isql -user "$USER" -password "$PASSWORD" -input '/firebird/database.sql' "$HOST:$DATABASE" +sleep 1s +cat /etc/hosts +/usr/local/firebird/bin/isql -user "$USER" -password "$PASSWORD" -input '/firebird/database.sql' "host.docker.internal:$DATABASE" rm /firebird/database.sql echo "EXECUTE PROCEDURE SP_CREATE_COMPANY 'New Company'; COMMIT;" > /firebird/comp.sql -/usr/local/firebird/bin/isql -user "$USER" -password "$PASSWORD" -input '/firebird/comp.sql' "$HOST:$DATABASE" +/usr/local/firebird/bin/isql -user "$USER" -password "$PASSWORD" -input '/firebird/comp.sql' "host.docker.internal:$DATABASE" rm /firebird/comp.sql diff --git a/docker-compose/svjis-dev.yml b/docker-compose/svjis-dev.yml index 9995a24..f4cb82c 100644 --- a/docker-compose/svjis-dev.yml +++ b/docker-compose/svjis-dev.yml @@ -28,6 +28,8 @@ services: - TZ=Europe/Prague volumes: - ./svjis-data/firebird:/firebird + extra_hosts: + - "host.docker.internal:host-gateway" firebirdadmin: image: marianaldenhoevel/firebirdwebadmin:latest diff --git a/docker-compose/svjis-prod.yml b/docker-compose/svjis-prod.yml index 9b7aad6..8ce5c13 100644 --- a/docker-compose/svjis-prod.yml +++ b/docker-compose/svjis-prod.yml @@ -42,3 +42,5 @@ services: - TZ=Europe/Prague volumes: - ./svjis-data/firebird:/firebird + extra_hosts: + - "host.docker.internal:host-gateway"