Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

++ healthchecks to pg&redis #105

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 45 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ volumes:
nginx-shared-txs:
nginx-shared-cfg:

x-healthcheck-db-template: &pghealthcheck
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 30s
timeout: 30s
retries: 3

x-healthcheck-redis-template: &redishealthcheck
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 30s
retries: 3

services:

# Common nginx and database
Expand All @@ -26,18 +40,20 @@ services:
POSTGRES_PASSWORD: postgres
volumes:
- ./data/txs-db:/var/lib/postgresql/data
<<: *pghealthcheck

cfg-db:
image: postgres:14-alpine
environment:
POSTGRES_PASSWORD: postgres
volumes:
- ./data/cfg-db:/var/lib/postgresql/data

<<: *pghealthcheck

# Safe Transaction Service
txs-redis:
image: redis:alpine
<<: *redishealthcheck

txs-rabbitmq:
image: rabbitmq:alpine
Expand All @@ -49,8 +65,10 @@ services:
environment:
- ETHEREUM_NODE_URL=${RPC_NODE_URL}
depends_on:
- txs-db
- txs-redis
txs-db:
condition: service_healthy
txs-redis:
condition: service_healthy
working_dir: /app
volumes:
- nginx-shared-txs:/nginx
Expand All @@ -65,24 +83,41 @@ services:
- RUN_MIGRATIONS=1
- WORKER_QUEUES=default,indexing
depends_on:
- txs-db
- txs-redis
txs-db:
condition: service_healthy
txs-redis:
condition: service_healthy
command: docker/web/celery/worker/run.sh

txs-worker-contracts-tokens:
<<: *txs-worker
environment:
- WORKER_QUEUES=contracts,tokens
- ETHEREUM_NODE_URL=${RPC_NODE_URL}
depends_on:
txs-db:
condition: service_healthy
txs-redis:
condition: service_healthy

txs-worker-notifications-webhooks:
<<: *txs-worker
environment:
- WORKER_QUEUES=notifications,webhooks
- ETHEREUM_NODE_URL=${RPC_NODE_URL}
depends_on:
txs-db:
condition: service_healthy
txs-redis:
condition: service_healthy

txs-scheduler:
<<: *txs-worker
depends_on:
txs-db:
condition: service_healthy
txs-redis:
condition: service_healthy
command: docker/web/celery/scheduler/run.sh

# Safe Config Service
Expand All @@ -94,18 +129,21 @@ services:
env_file:
- container_env_files/cfg.env
depends_on:
- cfg-db
cfg-db:
condition: service_healthy

# Safe Client Gateway
cgw-redis:
image: redis:alpine
<<: *redishealthcheck

cgw-web:
image: safeglobal/safe-client-gateway:${CGW_VERSION}
env_file:
- container_env_files/cgw.env
depends_on:
- cgw-redis
cgw-redis:
condition: service_healthy

ui:
image: safeglobal/safe-wallet-web:${UI_VERSION}
Expand Down