From b8db8cea331e2689802e76af2a6b338e643c1ac2 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Tue, 25 Jun 2024 23:12:07 +0300 Subject: [PATCH 1/3] test app: fix healthcheck --- ix-dev/test/nginx/app.yaml | 2 +- ix-dev/test/nginx/templates/docker-compose.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ix-dev/test/nginx/app.yaml b/ix-dev/test/nginx/app.yaml index 40dba2cf07..b0217de5de 100644 --- a/ix-dev/test/nginx/app.yaml +++ b/ix-dev/test/nginx/app.yaml @@ -33,4 +33,4 @@ sources: - https://hub.docker.com/r/adguard/adguardhome title: Nginx train: test -version: 1.0.1 +version: 1.0.2 diff --git a/ix-dev/test/nginx/templates/docker-compose.yaml b/ix-dev/test/nginx/templates/docker-compose.yaml index d1c055f89c..7e498efdcd 100644 --- a/ix-dev/test/nginx/templates/docker-compose.yaml +++ b/ix-dev/test/nginx/templates/docker-compose.yaml @@ -4,7 +4,7 @@ services: ports: - {{ values.network.web_port }}:80 healthcheck: - test: {{ "curl -f http://localhost:%s" | format(values.network.web_port) }} + test: "curl --fail --silent http://localhost:80" interval: 10s timeout: 10s retries: 5 From c7a1d38f48914cb1dc1fb94d9073a357af3c5415 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Wed, 26 Jun 2024 13:30:14 +0300 Subject: [PATCH 2/3] add additional container --- .../test/nginx/templates/docker-compose.yaml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ix-dev/test/nginx/templates/docker-compose.yaml b/ix-dev/test/nginx/templates/docker-compose.yaml index 7e498efdcd..b4b0b20d30 100644 --- a/ix-dev/test/nginx/templates/docker-compose.yaml +++ b/ix-dev/test/nginx/templates/docker-compose.yaml @@ -3,9 +3,29 @@ services: image: nginx ports: - {{ values.network.web_port }}:80 + depends_on: + perms: + condition: service_completed_successfully healthcheck: test: "curl --fail --silent http://localhost:80" interval: 10s timeout: 10s retries: 5 start_period: 30s + perms: + image: bash + user: root + deploy: + resources: + limits: + cpus: "1.0" + memory: 512m + entrypoint: + - bash + - -c + command: + - | + echo "I'm simulating permissions..." + sleep 10 + echo "Done simulating permissions" + exit 0 From 011f848d28a0dc69582b1a5cd1754fa7fe32b743 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Wed, 26 Jun 2024 13:36:55 +0300 Subject: [PATCH 3/3] add actual volume --- ix-dev/test/nginx/templates/docker-compose.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ix-dev/test/nginx/templates/docker-compose.yaml b/ix-dev/test/nginx/templates/docker-compose.yaml index b4b0b20d30..9b1814a108 100644 --- a/ix-dev/test/nginx/templates/docker-compose.yaml +++ b/ix-dev/test/nginx/templates/docker-compose.yaml @@ -12,6 +12,9 @@ services: timeout: 10s retries: 5 start_period: 30s + volumes: + - /mnt/nginx/dir_0:/mnt/directories/dir1 + - docker-volume-nginx:/mnt/directories/dir2 perms: image: bash user: root @@ -25,7 +28,15 @@ services: - -c command: - | - echo "I'm simulating permissions..." + echo "applying permissions..." + chmod 777 /mnt/directories/dir1 + chmod 777 /mnt/directories/dir2 sleep 10 - echo "Done simulating permissions" + echo "Done applying permissions" exit 0 + volumes: + - /usr/docker-nginx:/mnt/directories/dir1 + - docker-volume-nginx:/mnt/directories/dir2 + +volumes: + docker-volume-nginx: {}