diff --git a/Dockerfile b/Dockerfile index 1425dea..c18410c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,9 +48,9 @@ RUN chown -R nginx:nginx /usr/share/nginx/html && \ # Expose port 80 EXPOSE 80 -# Health check +# Health check (use 127.0.0.1 to force IPv4) HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD wget --no-verbose --tries=1 --spider http://localhost/ || exit 1 + CMD wget --no-verbose --tries=1 --spider http://127.0.0.1/ || exit 1 # Run nginx CMD ["nginx", "-g", "daemon off;"] diff --git a/docker-compose.yml b/docker-compose.yml index 65bd193..6f0f8a4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: - "80:80" restart: unless-stopped healthcheck: - test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost/"] + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1/"] interval: 30s timeout: 10s retries: 3