How to deploy Go app alongside Nginx using Docker compose?
I’m trying to follow this guide to deploy a Go app and Nginx using Docker Compose: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-go-web-application-with-docker-and-nginx-on-ubuntu-18-04
The problem I am having is that my Go application is stuck restarting indefinitely - it doesn’t seem to launch successfully. Nginx and Proxy Companion are running successfully, however. Furthermore,when I go to my domain, which is specified in the docker-compose file for the Go app, I am able to get to an https secured 502 bad gateway. I think this means the docker container for the Go app is being created successfully, but the actual web server isn’t able to listen on port 80. I created all of the Docker/Docker-Compose files to match the tutorial exactly so I’m not sure what the issue is. If I build the Docker file for my go application in isolation, without docker-compose, I can build and run the server. It’s just when I try to to use docker-compose it gets stuck in the restarting status. Any thoughts?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×