mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-17 17:26:42 +02:00
Added health check and restart policy to openresty
This commit is contained in:
parent
3587531bda
commit
6c966bce2e
@ -3,7 +3,7 @@
|
|||||||
restart: {{ DOCKER_RESTART_POLICY }}
|
restart: {{ DOCKER_RESTART_POLICY }}
|
||||||
{% if application_id | has_env %}
|
{% if application_id | has_env %}
|
||||||
env_file:
|
env_file:
|
||||||
- "{{docker_compose.files.env}}"
|
- "{{ docker_compose.files.env }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
logging:
|
logging:
|
||||||
driver: journald
|
driver: journald
|
||||||
|
@ -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
|
1
roles/svc-prx-openresty/templates/env.j2
Normal file
1
roles/svc-prx-openresty/templates/env.j2
Normal file
@ -0,0 +1 @@
|
|||||||
|
{# Dummy file to use base template #}
|
@ -9,10 +9,10 @@
|
|||||||
detached_files:
|
detached_files:
|
||||||
- "docker-compose.yml"
|
- "docker-compose.yml"
|
||||||
|
|
||||||
- name: "For '{{ application_id }}': create {{docker_compose.files.env}}"
|
- name: "For '{{ application_id }}': create {{ docker_compose.files.env }}"
|
||||||
template:
|
template:
|
||||||
src: "env.j2"
|
src: "env.j2"
|
||||||
dest: "{{docker_compose.files.env}}"
|
dest: "{{ docker_compose.files.env }}"
|
||||||
mode: "0770"
|
mode: "0770"
|
||||||
force: yes
|
force: yes
|
||||||
notify: docker compose up
|
notify: docker compose up
|
||||||
|
@ -83,7 +83,7 @@ x-op-app: &app
|
|||||||
command: "./docker/prod/seeder"
|
command: "./docker/prod/seeder"
|
||||||
container_name: {{ openproject_seeder_name }}
|
container_name: {{ openproject_seeder_name }}
|
||||||
env_file:
|
env_file:
|
||||||
- "{{docker_compose.files.env}}"
|
- "{{ docker_compose.files.env }}"
|
||||||
logging:
|
logging:
|
||||||
driver: journald
|
driver: journald
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
dest: "{{ NGINX.DIRECTORIES.HTTP.SERVERS }}{{ domain }}.conf"
|
dest: "{{ NGINX.DIRECTORIES.HTTP.SERVERS }}{{ domain }}.conf"
|
||||||
notify: restart openresty
|
notify: restart openresty
|
||||||
|
|
||||||
- name: "create {{docker_compose.files.env}}"
|
- name: "create {{ docker_compose.files.env }}"
|
||||||
template:
|
template:
|
||||||
src: "database.j2"
|
src: "database.j2"
|
||||||
dest: "{{docker_compose.files.env}}"
|
dest: "{{ docker_compose.files.env }}"
|
||||||
mode: "0770"
|
mode: "0770"
|
||||||
force: yes
|
force: yes
|
||||||
notify: docker compose up
|
notify: docker compose up
|
||||||
|
Loading…
x
Reference in New Issue
Block a user