Skip to content

Commit

Permalink
healthchecks to restart web container when app restarted
Browse files Browse the repository at this point in the history
  • Loading branch information
oscgonfer committed Sep 19, 2024
1 parent 24d1925 commit 3d1f860
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions compose/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ services:
memory: 2gb
volumes:
- "../:/app"
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:3000"]
timeout: 10s
#command: rails server -p 3000 -b '0.0.0.0'
#command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
environment:
Expand Down
4 changes: 3 additions & 1 deletion compose/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ services:
web:
image: nginx
depends_on:
- app
app:
condition: service_healthy
restart: true
ports:
- 80:80
- 80:80/udp
Expand Down

0 comments on commit 3d1f860

Please sign in to comment.