Wait for postgres to become ready before starting other containers
parent
fc5307a971
commit
3da7228f35
|
@ -6,6 +6,13 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- "${DATA_DIR:?specify data dir in .env file}/postgres:/var/lib/postgresql/data:rw"
|
- "${DATA_DIR:?specify data dir in .env file}/postgres:/var/lib/postgresql/data:rw"
|
||||||
restart: always
|
restart: always
|
||||||
|
healthcheck:
|
||||||
|
test: pg_isready -h localhost -U postgres
|
||||||
|
interval: 30s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 3
|
||||||
|
start_period: 1h
|
||||||
|
start_interval: 3s
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "host.docker.internal:host-gateway"
|
- "host.docker.internal:host-gateway"
|
||||||
ports:
|
ports:
|
||||||
|
@ -36,6 +43,9 @@ services:
|
||||||
memory: 1G
|
memory: 1G
|
||||||
links:
|
links:
|
||||||
- postgres:db
|
- postgres:db
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
environment:
|
environment:
|
||||||
LISTER_METRICS_PORT: '8080'
|
LISTER_METRICS_PORT: '8080'
|
||||||
LISTER_POSTGRES_URL: "postgres://postgres:${POSTGRES_PASSWORD}@db/bluesky?sslmode=disable"
|
LISTER_POSTGRES_URL: "postgres://postgres:${POSTGRES_PASSWORD}@db/bluesky?sslmode=disable"
|
||||||
|
@ -57,6 +67,9 @@ services:
|
||||||
memory: 1G
|
memory: 1G
|
||||||
links:
|
links:
|
||||||
- postgres:db
|
- postgres:db
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
environment:
|
environment:
|
||||||
CONSUMER_METRICS_PORT: '8080'
|
CONSUMER_METRICS_PORT: '8080'
|
||||||
CONSUMER_POSTGRES_URL: "postgres://postgres:${POSTGRES_PASSWORD}@db/bluesky?sslmode=disable"
|
CONSUMER_POSTGRES_URL: "postgres://postgres:${POSTGRES_PASSWORD}@db/bluesky?sslmode=disable"
|
||||||
|
@ -79,6 +92,9 @@ services:
|
||||||
memory: 4G
|
memory: 4G
|
||||||
links:
|
links:
|
||||||
- postgres:db
|
- postgres:db
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
dns:
|
dns:
|
||||||
- 1.1.1.1
|
- 1.1.1.1
|
||||||
- 8.8.8.8
|
- 8.8.8.8
|
||||||
|
@ -103,3 +119,6 @@ services:
|
||||||
- "0.0.0.0:9560:9560"
|
- "0.0.0.0:9560:9560"
|
||||||
links:
|
links:
|
||||||
- postgres:postgres
|
- postgres:postgres
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
|
Loading…
Reference in New Issue