added possibility to change port (#28)

This commit is contained in:
Mariusz Skarupiński
2022-01-13 21:17:28 +01:00
committed by GitHub
parent 2848086935
commit 896e049868
4 changed files with 5 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ services:
env_file: secrets.env
environment:
DB_HOST: "database"
DB_PORT: 5432
volumes:
- lbs:/lbs

View File

@@ -5,6 +5,7 @@ services:
env_file: secrets.env
environment:
DB_HOST: "database"
DB_PORT: 5432
volumes:
- lbs:/lbs

View File

@@ -1,9 +1,9 @@
#!/bin/sh
echo "********************************************************"
echo "Waiting for the database server to start on port 5432"
echo "Waiting for the database server to start on port ${DB_PORT:-5432}"
echo "********************************************************"
while ! `nc -z database 5432`; do sleep 3; done
while ! `nc -z database ${DB_PORT:-5432}`; do sleep 3; done
echo "******** Database Server has started "
echo "********************************************************"

View File

@@ -1,6 +1,6 @@
spring:
datasource:
url: "jdbc:postgresql://${DB_HOST:localhost}:5432/lbs"
url: "jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/lbs"
username: "lbs"
password: "lsb123"
jpa: