diff --git a/roles/docker-container/templates/base.yml.j2 b/roles/docker-container/templates/base.yml.j2 index cd8872e2..f4747469 100644 --- a/roles/docker-container/templates/base.yml.j2 +++ b/roles/docker-container/templates/base.yml.j2 @@ -3,7 +3,7 @@ restart: {{ DOCKER_RESTART_POLICY }} {% if application_id | has_env %} env_file: - - "{{docker_compose.files.env}}" + - "{{ docker_compose.files.env }}" {% endif %} logging: driver: journald diff --git a/roles/svc-prx-openresty/templates/docker-compose.yml.j2 b/roles/svc-prx-openresty/templates/docker-compose.yml.j2 index 17aa1458..5e719990 100644 --- a/roles/svc-prx-openresty/templates/docker-compose.yml.j2 +++ b/roles/svc-prx-openresty/templates/docker-compose.yml.j2 @@ -1,5 +1,6 @@ {% include 'roles/docker-compose/templates/base.yml.j2' %} openresty: + {% include 'roles/docker-container/templates/base.yml.j2' %} container_name: {{ OPENRESTY_CONTAINER }} image: {{ OPENRESTY_IMAGE }}:{{ OPENRESTY_VERSION }} network_mode: "host" @@ -12,4 +13,9 @@ - {{ NGINX.DIRECTORIES.DATA.WELL_KNOWN }}:{{ NGINX.DIRECTORIES.DATA.WELL_KNOWN }}:ro - {{ LETSENCRYPT_WEBROOT_PATH }}:{{ LETSENCRYPT_WEBROOT_PATH }}:ro - {{ LETSENCRYPT_BASE_PATH }}:{{ LETSENCRYPT_BASE_PATH }}:ro - command: ["openresty", "-g", "daemon off;"] \ No newline at end of file + command: ["openresty", "-g", "daemon off;"] + healthcheck: + test: ["CMD", "openresty", "-t", "-q"] + interval: 30s + timeout: 5s + retries: 3 \ No newline at end of file diff --git a/roles/svc-prx-openresty/templates/env.j2 b/roles/svc-prx-openresty/templates/env.j2 new file mode 100644 index 00000000..34c9eb15 --- /dev/null +++ b/roles/svc-prx-openresty/templates/env.j2 @@ -0,0 +1 @@ +{# Dummy file to use base template #} \ No newline at end of file diff --git a/roles/web-app-akaunting/tasks/main.yml b/roles/web-app-akaunting/tasks/main.yml index 7919c800..b67446da 100644 --- a/roles/web-app-akaunting/tasks/main.yml +++ b/roles/web-app-akaunting/tasks/main.yml @@ -9,10 +9,10 @@ detached_files: - "docker-compose.yml" -- name: "For '{{ application_id }}': create {{docker_compose.files.env}}" +- name: "For '{{ application_id }}': create {{ docker_compose.files.env }}" template: src: "env.j2" - dest: "{{docker_compose.files.env}}" + dest: "{{ docker_compose.files.env }}" mode: "0770" force: yes notify: docker compose up diff --git a/roles/web-app-openproject/templates/docker-compose.yml.j2 b/roles/web-app-openproject/templates/docker-compose.yml.j2 index 41aaddbb..b7645cd4 100644 --- a/roles/web-app-openproject/templates/docker-compose.yml.j2 +++ b/roles/web-app-openproject/templates/docker-compose.yml.j2 @@ -83,7 +83,7 @@ x-op-app: &app command: "./docker/prod/seeder" container_name: {{ openproject_seeder_name }} env_file: - - "{{docker_compose.files.env}}" + - "{{ docker_compose.files.env }}" logging: driver: journald restart: on-failure diff --git a/roles/web-app-syncope/tasks/main.yml b/roles/web-app-syncope/tasks/main.yml index 42165351..569ba1ce 100644 --- a/roles/web-app-syncope/tasks/main.yml +++ b/roles/web-app-syncope/tasks/main.yml @@ -13,10 +13,10 @@ dest: "{{ NGINX.DIRECTORIES.HTTP.SERVERS }}{{ domain }}.conf" notify: restart openresty -- name: "create {{docker_compose.files.env}}" +- name: "create {{ docker_compose.files.env }}" template: src: "database.j2" - dest: "{{docker_compose.files.env}}" + dest: "{{ docker_compose.files.env }}" mode: "0770" force: yes notify: docker compose up