Skip to content

Commit

Permalink
Invite: Add container health checks
Browse files Browse the repository at this point in the history
  • Loading branch information
quartje committed Nov 7, 2023
1 parent b72cc83 commit 5954512
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions roles/invite/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
log_driver: local
etc_hosts:
host.docker.internal: host-gateway
healthcheck:
test: ["CMD", "wget", "-no-verbose", "--tries=1", "--spider", "http://localhost:8080/internal/health" ]
interval: 10s
timeout: 10s
retries: 3
start_period: 10s
when: not serverconfigfiles.changed

- name: Create and (re)start the server container
Expand Down Expand Up @@ -81,6 +87,14 @@
traefik.http.routers.inviteclient.rule: "Host(`invite.{{ base_domain }}`)"
traefik.http.routers.inviteclient.tls: "true"
traefik.enable: "true"
healthcheck:
test: ["CMD", "curl", "--fail" , "http://localhost" ]
interval: 10s
timeout: 10s
retries: 3
start_period: 10s
env:
HTTPD_CSP: "{{ httpd_csp.strict_with_static_img }}"

- name: Create the welcome container
community.docker.docker_container:
Expand All @@ -95,6 +109,14 @@
traefik.http.routers.invitewelcome.rule: "Host(`welcome.{{ base_domain }}`)"
traefik.http.routers.invitewelcome.tls: "true"
traefik.enable: "true"
healthcheck:
test: ["CMD", "curl", "--fail" , "http://localhost" ]
interval: 10s
timeout: 10s
retries: 3
start_period: 10s
env:
HTTPD_CSP: "{{ httpd_csp.strict_with_static_img }}"

- name: Create and start the mock provisioning container
community.docker.docker_container:
Expand All @@ -115,6 +137,12 @@
traefik.http.routers.invitemock.tls: "true"
traefik.http.services.invitemock.loadbalancer.server.port: "8081"
traefik.enable: "true"
healthcheck:
test: ["CMD", "wget", "-no-verbose", "--tries=1", "--spider", "http://localhost:8081/internal/health" ]
interval: 10s
timeout: 10s
retries: 3
start_period: 10s
when: not mockconfigfiles.changed

- name: Create and (re)start the mock provisioning container
Expand Down

0 comments on commit 5954512

Please sign in to comment.