Skip to content

Commit

Permalink
build: 🏗️ Add healthcheck to nautobot container and update worker to …
Browse files Browse the repository at this point in the history
…not start until service_healthy.
  • Loading branch information
jdrew82 committed Jul 11, 2023
1 parent da27a46 commit 8ce83b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion development/docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ services:
- "-c" # this is to evaluate the $NAUTOBOT_LOG_LEVEL from the env
- "watchmedo auto-restart --directory './' --pattern '*.py' --recursive -- nautobot-server celery worker -l $$NAUTOBOT_LOG_LEVEL --events" ## $$ because of docker-compose
depends_on:
- "nautobot"
nautobot:
condition: "service_healthy"
healthcheck:
interval: "30s"
timeout: "10s"
Expand Down
10 changes: 10 additions & 0 deletions development/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ version: "3.8"
services:
nautobot:
command: "nautobot-server runserver 0.0.0.0:8080"
healthcheck:
interval: 5s
timeout: 5s
start_period: 10m # intentionally conservative upper bound for `npm install` time in a fresh setup
retries: 3
test:
- "CMD"
- "curl"
- "-f"
- "http://localhost:8080/health/"
ports:
- "8080:8080"
volumes:
Expand Down

0 comments on commit 8ce83b5

Please sign in to comment.