From e52aa3a411dc9fc087ec6c78a52e54288b87a833 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 4 Apr 2024 12:24:58 +0200 Subject: [PATCH] Optimized restart policies --- roles/docker-moodle/templates/docker-compose.yml.j2 | 3 +++ .../templates/docker-compose.yml.j2 | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/roles/docker-moodle/templates/docker-compose.yml.j2 b/roles/docker-moodle/templates/docker-compose.yml.j2 index 4940305e..3efdf4ca 100644 --- a/roles/docker-moodle/templates/docker-compose.yml.j2 +++ b/roles/docker-moodle/templates/docker-compose.yml.j2 @@ -5,6 +5,9 @@ services: image: docker.io/bitnami/moodle:latest ports: - 127.0.0.1:{{http_port}}:8080 + restart: {{docker_restart_policy}} + logging: + driver: journald environment: - MOODLE_DATABASE_HOST={{database_host}} - MOODLE_DATABASE_PORT_NUMBER=3306 diff --git a/roles/docker-openproject/templates/docker-compose.yml.j2 b/roles/docker-openproject/templates/docker-compose.yml.j2 index 9b71a8d6..67f05b21 100644 --- a/roles/docker-openproject/templates/docker-compose.yml.j2 +++ b/roles/docker-openproject/templates/docker-compose.yml.j2 @@ -1,7 +1,8 @@ version: "3.7" x-op-app: &app - restart: {{docker_restart_policy}} + logging: + driver: journald image: custom_openproject environment: OPENPROJECT_HTTPS: "${OPENPROJECT_HTTPS}" @@ -27,10 +28,14 @@ services: image: memcached container_name: openproject-memcached restart: {{docker_restart_policy}} + logging: + driver: journald {% include 'templates/docker/container/networks.yml.j2' %} proxy: restart: {{docker_restart_policy}} + logging: + driver: journald image: custom_openproject container_name: openproject-proxy command: "./docker/prod/proxy" @@ -48,6 +53,7 @@ services: web: <<: *app + restart: {{docker_restart_policy}} command: "./docker/prod/web" container_name: openproject-web {% include 'templates/docker/container/networks.yml.j2' %} @@ -68,6 +74,9 @@ services: autoheal: image: willfarrell/autoheal:1.2.0 container_name: openproject-autoheal + restart: {{docker_restart_policy}} + logging: + driver: journald volumes: - "/var/run/docker.sock:/var/run/docker.sock" environment: @@ -77,6 +86,7 @@ services: worker: <<: *app + restart: {{docker_restart_policy}} command: "./docker/prod/worker" container_name: openproject-worker {% include 'templates/docker/container/networks.yml.j2' %} @@ -88,6 +98,7 @@ services: cron: <<: *app + restart: {{docker_restart_policy}} command: "./docker/prod/cron" container_name: openproject-cron {% include 'templates/docker/container/networks.yml.j2' %}