I’m working on setting up my development/deployment pipeline for my ubuntu Droplet. I used the one-click Docker Droplet and have followed the guides Install nginx, Initial Server Setup, and Secure nginx.
Where I get lost is how the Docker container and nginx/nginx server block are tied together. I have my image on Docker Hub, building on changes to my GitHub repo. That works great. I can pull the images onto my server, and run them, but I don’t know how to access them or set them up with a server block.
For example, this guide says I should be able to run a container, map it to port 8080, and access it via http://my-ip:8080 but that doesn’t work for me. Thinking 8080 probably isn’t exposed by default, I allowed it in ufw, restarted ufw, and tried again, but no luck. Trying this, and trying to figure out why it doesn’t work, and if it even should, has left me more confused.
Any input that could help clear up this last piece of the puzzle appreciated.
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.