From b8ec9ed5f249f3a52a9b1a08abe42dfd59e29847 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Mon, 13 Mar 2023 21:59:39 -0700 Subject: [PATCH] updated docker-compose.yaml to enable variable loading from a env file --- docker-compose.yaml | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 296abb8..bfc248b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -7,21 +7,36 @@ volumes: db: services: - #db: - # image: postgres:latest - # #ports: - # # - "5432:5432" - # networks: - # - newsbot - # volumes: - # - db:/var/lib/postgresql/data + db: + image: postgres:latest + environment: + POSTGRES_USER: ${PostgresUser} + POSTGRES_PASSWORD: ${PostgresPassword} + POSTGRES_DB: ${PostgresDatabaseName} + ports: + - "5432:5432" + networks: + - newsbot + volumes: + - db:/var/lib/postgresql/data + healthcheck: + test: [ “CMD-SHELL”, “pg_isready” ] + interval: "1s" + timeout: "5s" + retries: 10 + + adminer: + image: adminer + restart: always + ports: + - "8080:8080" api: image: newsbot.collector:latest environment: # Used for database migrations GOOSE_DRIVER: "postgres" - GOOSE_DBSTRING: "host=localhost user=postgres password=postgres dbname=postgres sslmode=disable" + GOOSE_DBSTRING: "host=localhost user=${PostgresUser} password=${PostgresPassword} dbname=${PostgresDatabaseName} sslmode=disable" SERVER_ADDRESS: "localhost" @@ -29,7 +44,7 @@ services: Logging__LogLevel__Microsoft.AspNetCore: "Warning" Logging__LogLevel__Hangfire: "Information" - ConnectionStrings__Database: "Host=localhost;Username=postgres;Password=postgres;Database=postgres;sslmode=disable" + ConnectionStrings__Database: "Host=localhost;Username=${PostgresUser};Password=${PostgresPassword};Database=${PostgresDatabaseName};sslmode=disable" # Enable/Disable Reddit monitoring Reddit__IsEnabled: false @@ -42,8 +57,8 @@ services: TWITCH__IsEnabled: false # Set your Twitch Developer ID and Secrets here and they will be used to collect updates. - TWITCH__ClientID: "" - TWITCH__ClientSecret: "" + Twitch__ClientID: ${TwitchClientId} + Twitch__ClientSecret: ${TwitchClientSecret} # If you want to collect news on Final Fantasy XIV, set this to true FFXIV__IsEnabled: false