From ccf130ad283a4821ac3e09d169af6c97a30dd2ed Mon Sep 17 00:00:00 2001 From: mbremer Date: Mon, 26 Jul 2021 08:37:46 +0200 Subject: [PATCH] environment variable for hostname --- README.md | 17 ++++++++++------- src/main/resources/application.properties | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0d3ac94..96fa0bd 100644 --- a/README.md +++ b/README.md @@ -26,17 +26,20 @@ The application is now runnable using `java -jar target/quarkus-app/quarkus-run. ### Creating a native executable -You can create a native executable using: -```shell script -./mvnw package -Pnative -``` - -Or, if you don't have GraalVM installed, you can run the native executable build in a container using: +You can create a native executable with no GraalVM installed: ```shell script ./mvnw package -Pnative -Dquarkus.native.container-build=true ``` -You can then execute your native executable with: `./target/buerokalender-0.1.0-SNAPSHOT-runner` +...and execute it: +```shell script +export POSTGRES_HOST=localhost +export POSTGRES_PORT=5432 +export POSTGRES_USER=buerokalender +export POSTGRES_PASSWORD=buerokalender + +target/buerokalender-1.1.0-runner +``` Push to docker.io: ```shell script diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index ffef7be..c189b11 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,5 @@ # Database -%prod.quarkus.datasource.jdbc.url = jdbc:postgresql://db:${POSTGRES_PORT:5432}/buerokalender +%prod.quarkus.datasource.jdbc.url = jdbc:postgresql://${POSTGRES_HOST:db}:${POSTGRES_PORT:5432}/buerokalender %prod.quarkus.datasource.username = ${POSTGRES_USER:buerokalender} %prod.quarkus.datasource.password = ${POSTGRES_PASSWORD:buerokalender} %prod.quarkus.datasource.jdbc.max-size=16