Add healthcheck to nginx service in docker-compose

This commit is contained in:
LRVT
2026-02-04 22:34:48 +01:00
committed by GitHub
parent b6628c6d53
commit bfc3446a85

View File

@@ -16,6 +16,13 @@ services:
find /usr/share/nginx/html/assets -type f -name "*.js" -exec sed -i 's|https://oss-collab\.excalidraw\.com|'$$VITE_APP_WS_SERVER_URL'|g' {} + find /usr/share/nginx/html/assets -type f -name "*.js" -exec sed -i 's|https://oss-collab\.excalidraw\.com|'$$VITE_APP_WS_SERVER_URL'|g' {} +
echo "Starting nginx..." echo "Starting nginx..."
nginx -g 'daemon off;' nginx -g 'daemon off;'
stdin_open: true
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:80/ >/dev/null 2>&1 || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- VITE_APP_WS_SERVER_URL=https://draw2gether.example.com # define your custom url for selfhosted excalidraw-room below - VITE_APP_WS_SERVER_URL=https://draw2gether.example.com # define your custom url for selfhosted excalidraw-room below
@@ -35,6 +42,12 @@ services:
expose: expose:
- 80 - 80
restart: unless-stopped restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:80/ >/dev/null 2>&1 || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
#networks: #networks:
# - proxy # - proxy
#labels: #labels: