Add health checks for mastodon

This commit is contained in:
Ivan R. 2024-11-14 20:05:23 +05:00
parent 4aca41125e
commit 9a9da8e7d0
Signed by: lumin
GPG key ID: E0937DC7CD6D3817
2 changed files with 23 additions and 3 deletions

View file

@ -138,16 +138,20 @@ backend comfycamp
backend mastodon
mode http
option httpchk GET /health
http-check expect status 200
http-response set-header Referrer-Policy same-origin
http-response set-header Onion-Location http://mcomfyzeyibt2unmkttoxa2li2dzpsljcp3sasrioqsks4ayrl5kk2ad.onion%[capture.req.uri]
server s1 mastodon-web-1:3000 check
server s2 mastodon-web-2:3000 check
server s1 mastodon-web-1:3000 check inter 10s
server s2 mastodon-web-2:3000 check inter 10s
backend mastodon_streaming
mode http
option httpchk GET /api/v1/streaming/health
http-check expect status 200
option http-server-close
timeout tunnel 1h
server green mastodon-streaming:4000 check
server green mastodon-streaming:4000 check inter 10s
backend vaultwarden
mode http

View file

@ -56,6 +56,14 @@
volumes:
- mastodon-public-system:/mastodon/public/system
restart_policy: unless-stopped
healthcheck:
test: ["CMD", "curl", "--fail", "127.0.0.1:3000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# TODO: enable after ansible update
# state: healthy
loop: ["1", "2"]
- name: Create streaming container
become: true
@ -69,6 +77,14 @@
- name: postgresql
- name: haproxy
restart_policy: unless-stopped
healthcheck:
test: ["CMD", "curl", "--fail", "127.0.0.1:4000/api/v1/streaming/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# TODO: enable after ansible update
# state: healthy
- name: Create sidekiq container
become: true
community.docker.docker_container: