From c4534114443ab0f415eb4ae0609073c14b91b1b9 Mon Sep 17 00:00:00 2001 From: Cedric Date: Sat, 11 Jan 2025 21:37:11 +0100 Subject: [PATCH] fixes --- docker-compose.yml | 25 ++++++++++++----------- src/main/resources/application.properties | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index a4f4356..886656c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,29 +1,27 @@ version: "3.8" - services: - app: + xpensely-server: image: tea.zendric.de/cedric/xpensely-server:latest - container_name: XpenselyServer + container_name: xpensely-server ports: - - "3636:8080" + - 3636:8080 environment: GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID} GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET} DB_PORT: 5434 - DB_CONTAINER: ${DB_P_CONTAINER} DB_NAME: ${DB_P_NAME} DB_USERNAME: ${DB_USERNAME} DB_PASSWORD: ${DB_PASSWORD} depends_on: - - postgresdb + postgresdb: + condition: service_healthy networks: - xpensely-network - postgresdb: image: postgres:14 container_name: postgresdb ports: - - "5434:5432" + - 5434:5432 environment: POSTGRES_DB: ${DB_P_NAME} POSTGRES_USER: ${DB_USERNAME} @@ -33,9 +31,12 @@ services: volumes: - db_data:/var/lib/postgresql/data restart: unless-stopped - + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME}"] + interval: 10s + timeout: 5s + retries: 5 volumes: - db_data: - + db_data: null networks: - xpensely-network: + xpensely-network: null diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index cfb0d66..61116e5 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -8,7 +8,7 @@ spring.security.oauth2.client.registration.google.client-secret=${GOOGLE_CLIENT_ spring.security.oauth2.resourceserver.jwt.issuer-uri=https://accounts.google.com # PostgreSQL Configuration -spring.datasource.url=jdbc:postgresql://${DB_P_CONTAINER}:${DB_PORT}/${DB_P_NAME} +spring.datasource.url=jdbc:postgresql://postgresdb:${DB_PORT}/${DB_P_NAME} spring.datasource.username=${DB_USERNAME} spring.datasource.password=${DB_PASSWORD} spring.datasource.driver-class-name=org.postgresql.Driver