From 35a94cb7e58e9876badbdd19d7ec6236c76d35f6 Mon Sep 17 00:00:00 2001 From: Ryan Merolle Date: Sat, 22 Oct 2022 09:40:03 -0400 Subject: [PATCH] Update docker-compose.yml Address housekeeping tracebacks & remove whitespace --- docker-compose.yml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index c20f7e9..780c732 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,9 +6,13 @@ services: - postgres - redis - redis-cache - - netbox-worker env_file: env/netbox.env user: 'unit:root' + healthcheck: + start_period: 60s + timeout: 3s + interval: 15s + test: "curl -f http://localhost:8080/api/ || exit 1" volumes: - ./configuration:/etc/netbox/config:z,ro - ./reports:/etc/netbox/reports:z,ro @@ -17,19 +21,29 @@ services: netbox-worker: <<: *netbox depends_on: - - redis - - postgres + netbox: + condition: service_healthy command: - /opt/netbox/venv/bin/python - /opt/netbox/netbox/manage.py - rqworker + healthcheck: + start_period: 20s + timeout: 3s + interval: 15s + test: "ps -aux | grep -v grep | grep -q rqworker || exit 1" netbox-housekeeping: <<: *netbox depends_on: - - redis - - postgres + netbox: + condition: service_healthy command: - /opt/netbox/housekeeping.sh + healthcheck: + start_period: 20s + timeout: 3s + interval: 15s + test: "ps -aux | grep -v grep | grep -q housekeeping || exit 1" # postgres postgres: @@ -56,7 +70,7 @@ services: - redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose env_file: env/redis-cache.env volumes: - - netbox-redis-cache-data:/data + - netbox-redis-cache-data:/data volumes: netbox-media-files: @@ -66,4 +80,4 @@ volumes: netbox-redis-data: driver: local netbox-redis-cache-data: - driver: local + driver: local