Browse Source

Fix docker compose services startup

pull/1947/head
ileko 2 years ago
parent
commit
dfb39cd883
  1. 15
      docker/docker-compose.build.yml
  2. 15
      docker/docker-compose.yml

15
docker/docker-compose.build.yml

@ -11,16 +11,31 @@ services:
REDIS_PASSWORD: ${REDIS_PASSWORD} REDIS_PASSWORD: ${REDIS_PASSWORD}
ports: ports:
- 3333:3333 - 3333:3333
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
postgres: postgres:
image: postgres:12 image: postgres:12
env_file: env_file:
- ../.env - ../.env
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
volumes: volumes:
- postgres:/var/lib/postgresql/data - postgres:/var/lib/postgresql/data
redis: redis:
image: 'redis:alpine' image: 'redis:alpine'
healthcheck:
test: ["CMD-SHELL","redis-cli ping | grep PONG"]
interval: 10s
timeout: 5s
retries: 5
volumes: volumes:
postgres: postgres:

15
docker/docker-compose.yml

@ -11,16 +11,31 @@ services:
REDIS_PASSWORD: ${REDIS_PASSWORD} REDIS_PASSWORD: ${REDIS_PASSWORD}
ports: ports:
- 3333:3333 - 3333:3333
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
postgres: postgres:
image: postgres:12 image: postgres:12
env_file: env_file:
- ../.env - ../.env
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
volumes: volumes:
- postgres:/var/lib/postgresql/data - postgres:/var/lib/postgresql/data
redis: redis:
image: 'redis:alpine' image: 'redis:alpine'
healthcheck:
test: ["CMD-SHELL","redis-cli ping | grep PONG"]
interval: 10s
timeout: 5s
retries: 5
volumes: volumes:
postgres: postgres:

Loading…
Cancel
Save