I have a Docker image, a server that expose the 9011 port and I can't change it. As suggested by a user. I am trying using Nginx as sidecar container described here.
My Dockerfile:
FROM fusionauth/fusionauth-app:latest
ENV DATABASE_URL=${DATABASE_URL} \
DATABASE_ROOT_USERNAME=${DATABASE_USERNAME} \
DATABASE_ROOT_PASSWORD=${DATABASE_PASSWORD} \
DATABASE_USERNAME=${DATABASE_USERNAME} \
DATABASE_PASSWORD=${DATABASE_PASSWORD} \
FUSIONAUTH_APP_MEMORY=${FUSIONAUTH_APP_MEMORY} \
FUSIONAUTH_APP_RUNTIME_MODE=${FUSIONAUTH_APP_RUNTIME_MODE} \
FUSIONAUTH_APP_URL=http://localhost:9011 \
SEARCH_TYPE=database
EXPOSE 9011
nginx.conf:
server {
listen 8080;
server_name _;
gzip on;
location / {
proxy_pass http://127.0.0.1:9011;
proxy_set_header X-Forwarded-Port 443;
}
location /health_check {
access_log off;
add_header 'Content-Type' 'application/json';
return 200 '{"status":"UP"}';
}
}
I added a health_check because it is required, it does not deploy otherwise. However, it fails and the in the log i read:
STARTUP HTTP probe failed 3 times consecutively for container "nginx-proxy" on path "/health_check". The instance was not started.
This is the Health check I added:
- Probe type: HTTP
- Path: /health_check
- Port: 8080
- Initial delay: 2
- Period: 5
- Failure threshold: 3
- Timeout: 1
Any hint?
Hi @Emaborsa2,
Welcome to the Google Cloud Community!
Cloud Run health checks are a mechanism to make sure Cloud Run clone instances of a revision are ready to serve traffic. Cloud Run health checks bypass upstream ingress and authentication restrictions.
Here are a few reasons that might be causing the error:
Here are a few steps that might help:
startupProbe:
httpGet:
path: /health_check
I hope this helps!