mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
wait for postgres container to start. provide env variables through .env file
This commit is contained in:
parent
59a2cbe80f
commit
ce701c2230
2 changed files with 13 additions and 11 deletions
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue