Healthcheck über 127.0.0.1 statt localhost
Im Container löst localhost auf ::1 auf, nginx lauscht aber nur auf IPv4 (listen 80;). Der Healthcheck bekam deshalb "Connection refused" und der Container stand dauerhaft auf unhealthy, obwohl er normal auslieferte. Jetzt frage ich 127.0.0.1 ab und verwerfe die Ausgabe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2faabbda3a
commit
dfd7583e62
1 file changed
+2
-1
+2
-1
@@ -46,5 +46,6 @@ RUN rm -rf /usr/share/nginx/html/.git \
|
|||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
# 127.0.0.1 statt localhost: localhost löst im Container auf ::1 auf, nginx lauscht nur auf IPv4
|
||||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||||
CMD wget -qO- http://localhost:80/ || exit 1
|
CMD wget -qO- http://127.0.0.1:80/ >/dev/null || exit 1
|
||||||
Reference in new issue
Block a user