Added health check and restart policy to openresty

This commit is contained in:
Kevin Veen-Birkenbach 2025-08-15 17:59:09 +02:00
parent 3587531bda
commit 6c966bce2e
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
6 changed files with 14 additions and 7 deletions

View File

@ -1,5 +1,6 @@
{% include 'roles/docker-compose/templates/base.yml.j2' %} {% include 'roles/docker-compose/templates/base.yml.j2' %}
openresty: openresty:
{% include 'roles/docker-container/templates/base.yml.j2' %}
container_name: {{ OPENRESTY_CONTAINER }} container_name: {{ OPENRESTY_CONTAINER }}
image: {{ OPENRESTY_IMAGE }}:{{ OPENRESTY_VERSION }} image: {{ OPENRESTY_IMAGE }}:{{ OPENRESTY_VERSION }}
network_mode: "host" network_mode: "host"
@ -13,3 +14,8 @@
- {{ LETSENCRYPT_WEBROOT_PATH }}:{{ LETSENCRYPT_WEBROOT_PATH }}:ro - {{ LETSENCRYPT_WEBROOT_PATH }}:{{ LETSENCRYPT_WEBROOT_PATH }}:ro
- {{ LETSENCRYPT_BASE_PATH }}:{{ LETSENCRYPT_BASE_PATH }}:ro - {{ LETSENCRYPT_BASE_PATH }}:{{ LETSENCRYPT_BASE_PATH }}:ro
command: ["openresty", "-g", "daemon off;"] command: ["openresty", "-g", "daemon off;"]
healthcheck:
test: ["CMD", "openresty", "-t", "-q"]
interval: 30s
timeout: 5s
retries: 3

View File

@ -0,0 +1 @@
{# Dummy file to use base template #}