From 5647033ae501a1fc79aa03994b19e63db88cbb49 Mon Sep 17 00:00:00 2001 From: ratelok Date: Sun, 3 Aug 2025 16:38:46 +0300 Subject: [PATCH] fix_nc --- docker-compose.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index e43e96b..8812e96 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,13 +2,15 @@ services: nginx: image: nginx:latest ports: - - "8080:80" + - "80:80" healthcheck: - test: ["CMD", "nc", "-z", "-v", "localhost", "80"] + test: ["CMD", "nc", "-z", "localhost", "80"] interval: 5s timeout: 10s retries: 15 start_period: 5s + command: > + sh -c "apt-get update && apt-get install -y netcat && nginx -g 'daemon off;'" networks: - app-network @@ -19,24 +21,28 @@ services: POSTGRES_USER: user POSTGRES_PASSWORD: password healthcheck: - test: ["CMD", "nc", "-z", "-v", "localhost", "5432"] + test: ["CMD", "nc", "-z", "localhost", "5432"] interval: 5s timeout: 10s retries: 15 start_period: 5s + command: > + sh -c "apt-get update && apt-get install -y netcat && docker-entrypoint.sh postgres" networks: - - app-network + - app-network redis: image: redis:latest healthcheck: - test: ["CMD", "nc", "-z", "-v", "localhost", "6379"] + test: ["CMD", "sh", "-c", "nc -z localhost 6379 || exit 1"] interval: 5s timeout: 10s retries: 15 start_period: 5s + command: > + sh -c "apk add --no-cache netcat-openbsd && redis-server" networks: - - app-network + - app-network networks: app-network: