Google App Engine – 502 error with custom docker image

I cannot seem to get my Craft CMS container to run in Google App Engine. I am building the image locally with a custom Dockerfile and pushing the image out to my project container registry.

The deploy goes fine, the /nginx_health checks show as a 200 in the logs, but every time I navigate to the page in the browser I see a 502 with the following error message in the GAE browser console:

[error] 34#34: *320 connect() failed (111: Connection refused) while connecting to upstream, client: 2607:f8b0:4007:818::2014, server: , request: "GET / HTTP/1.1", upstream: "", host: "" 

I am exposing port 8080 in the Dockerfile.

Here is my app.yaml:

runtime: custom
env: flex

    document_root: craftcms/web

 enable_health_check: False

  instances: 1

My nginx-app.conf file:

location / {
  # try to serve file directly, fallback to front controller
  try_files $uri /index.php$is_args$args;

Not sure if this matters, but this is how I’m closing out the Dockerfile:

RUN /scripts/

COPY ./config-env/supervisord.conf /etc/supervisord.conf
COPY ./config-env/php-fpm.conf /usr/local/etc/php-fpm.conf
CMD ["/usr/bin/supervisord", "-n"] does some busy work for Craft, the config files are copied over and then I explicitly call supervisord.

All I see in the browser is the 502/nginx page. Thoughts on other things I can try?

Source: Docker Questions