diff --git a/env.example b/env.example index cac828b..8548a28 100644 --- a/env.example +++ b/env.example @@ -10,11 +10,9 @@ TWITCH_CLIENT_SECRET=asd EVENTSUB_SECRET=asd DSN=postgres://nourybot:coolpassword@postgres:5432/nourybot?sslmode=disable -DB_HOST=postgres -DB_PORT=5432 -DB_USER=nourybot -DB_PASSWORD=coolpassword -DB_NAME=nourybot +POSTGRES_DB=nourybot +POSTGRES_USER=nourybot +POSTGRES_PASSWORD=coolpassword OWM_KEY=asd WOLFRAMALPHA_APP_ID=asd diff --git a/example.docker-compose b/example.docker-compose index 7870ae9..8e3122d 100644 --- a/example.docker-compose +++ b/example.docker-compose @@ -6,19 +6,23 @@ services: restart: unless-stopped env_file: .env depends_on: - - postgres + postgres: + condition: service_healthy volumes: - - "/tmp/CHANGE_ME/uploads:/public/uploads" + - "/tmp/CHANGEME/uploads:/public/uploads" ports: - "127.0.0.1:8080:8080" postgres: image: postgres restart: unless-stopped - environment: - POSTGRES_DB: nourybot - POSTGRES_USER: nourybot - POSTGRES_PASSWORD: coolpassword + env_file: .env volumes: - nourybotdb:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"] + interval: 5s + timeout: 5s + retries: 5 + start_period: 20s volumes: nourybotdb: