By Conor
Hi,
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?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
In case that you have another service listening on port 80 it could prevent the Nginx container from starting.
You can check that with the following command:
netstat -plant | grep 80
If you have Nginx installed on your host, you would need to stop it and disable it before you run the docker-compose up command.
Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.