Skip to content

Commit

Permalink
Merge pull request #360 from fablabbcn/better_docker_healthchecks
Browse files Browse the repository at this point in the history
healthchecks to restart web container when app restarted
  • Loading branch information
timcowlishaw authored Oct 7, 2024
2 parents 7796f9f + 3d1f860 commit f6e539a
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 f6e539a

Please sign in to comment.