|
@ -6,10 +6,6 @@ services: |
|
|
init: true |
|
|
init: true |
|
|
env_file: |
|
|
env_file: |
|
|
- ../.env |
|
|
- ../.env |
|
|
environment: |
|
|
|
|
|
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?connect_timeout=300&sslmode=prefer |
|
|
|
|
|
REDIS_HOST: redis |
|
|
|
|
|
REDIS_PASSWORD: ${REDIS_PASSWORD} |
|
|
|
|
|
ports: |
|
|
ports: |
|
|
- 3333:3333 |
|
|
- 3333:3333 |
|
|
depends_on: |
|
|
depends_on: |
|
@ -24,12 +20,13 @@ services: |
|
|
retries: 5 |
|
|
retries: 5 |
|
|
|
|
|
|
|
|
postgres: |
|
|
postgres: |
|
|
image: docker.io/library/postgres:15 |
|
|
image: docker.io/library/postgres:15-alpine |
|
|
container_name: gf-postgres-build |
|
|
container_name: gf-postgres-build |
|
|
env_file: |
|
|
env_file: |
|
|
- ../.env |
|
|
- ../.env |
|
|
healthcheck: |
|
|
healthcheck: |
|
|
test: ['CMD-SHELL', 'pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}'] |
|
|
test: |
|
|
|
|
|
['CMD-SHELL', 'pg_isready -d "$${POSTGRES_DB}" -U $${POSTGRES_USER}'] |
|
|
interval: 10s |
|
|
interval: 10s |
|
|
timeout: 5s |
|
|
timeout: 5s |
|
|
retries: 5 |
|
|
retries: 5 |
|
@ -41,9 +38,17 @@ services: |
|
|
container_name: gf-redis-build |
|
|
container_name: gf-redis-build |
|
|
env_file: |
|
|
env_file: |
|
|
- ../.env |
|
|
- ../.env |
|
|
command: ['redis-server', '--requirepass', $REDIS_PASSWORD] |
|
|
command: |
|
|
|
|
|
- /bin/sh |
|
|
|
|
|
- -c |
|
|
|
|
|
# - Double dollars, so that the variable is not expanded by Docker Compose |
|
|
|
|
|
# - Surround by quotes, so that the shell does not split the password |
|
|
|
|
|
# - The ${variable:?message} syntax causes shell to exit with a non-zero |
|
|
|
|
|
# code and print a message, when the variable is not set or empty |
|
|
|
|
|
- redis-server --requirepass "$${REDIS_PASSWORD:?REDIS_PASSWORD variable is not set}" |
|
|
healthcheck: |
|
|
healthcheck: |
|
|
test: ['CMD-SHELL', 'redis-cli --pass "$REDIS_PASSWORD" ping | grep PONG'] |
|
|
test: |
|
|
|
|
|
['CMD-SHELL', 'redis-cli --pass "$${REDIS_PASSWORD}" ping | grep PONG'] |
|
|
interval: 10s |
|
|
interval: 10s |
|
|
timeout: 5s |
|
|
timeout: 5s |
|
|
retries: 5 |
|
|
retries: 5 |
|
|