Merge pull request #34 from truenas/nginx-hc

test app: fix healthcheck
This commit is contained in:
Stavros Kois
2024-06-26 13:39:14 +03:00
committed by GitHub
2 changed files with 33 additions and 2 deletions

View File

@@ -33,4 +33,4 @@ sources:
- https://hub.docker.com/r/adguard/adguardhome
title: Nginx
train: test
version: 1.0.1
version: 1.0.2

View File

@@ -3,9 +3,40 @@ services:
image: nginx
ports:
- {{ values.network.web_port }}:80
depends_on:
perms:
condition: service_completed_successfully
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
start_period: 30s
volumes:
- /mnt/nginx/dir_0:/mnt/directories/dir1
- docker-volume-nginx:/mnt/directories/dir2
perms:
image: bash
user: root
deploy:
resources:
limits:
cpus: "1.0"
memory: 512m
entrypoint:
- bash
- -c
command:
- |
echo "applying permissions..."
chmod 777 /mnt/directories/dir1
chmod 777 /mnt/directories/dir2
sleep 10
echo "Done applying permissions"
exit 0
volumes:
- /usr/docker-nginx:/mnt/directories/dir1
- docker-volume-nginx:/mnt/directories/dir2
volumes:
docker-volume-nginx: {}