diff --git a/roles/mastodon/templates/docker-compose.yml b/roles/mastodon/templates/docker-compose.yml index cfbd2ae..939c534 100644 --- a/roles/mastodon/templates/docker-compose.yml +++ b/roles/mastodon/templates/docker-compose.yml @@ -63,6 +63,8 @@ services: stop_signal: SIGINT networks: backend: + healthcheck: + test: ['CMD', 'pg_isready', '-U', 'postgres'] volumes: - {{ mastodon_database_location }}:/var/lib/postgresql/data restart: always @@ -73,6 +75,8 @@ services: memswap_limit: 768mb networks: backend: + healthcheck: + test: ['CMD', 'redis-cli', 'ping'] volumes: - {{ mastodon_redis_location }}:/data restart: always @@ -123,6 +127,8 @@ services: networks: frontend: backend: + healthcheck: + test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1'] restart: always command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000 -b '0.0.0.0'" @@ -134,6 +140,8 @@ services: networks: frontend: backend: + healthcheck: + test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1'] depends_on: - db - redis @@ -153,6 +161,8 @@ services: networks: frontend: backend: + healthcheck: + test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"] restart: always command: bundle exec sidekiq