3 ms·
You might not need nginx if you are using Go. I would only add it if neccessary.
by kissgyorgy 7y ago
You might not need nginx if you are using Go. I would only add it if neccessary.
- y4mi 7y agoare you seriously telling people that they should run their application as root? you do know that ports <1000 (http: 80, https: 443) require root, right?
- zrail 7y agoYou only need root to open the port. Once you do that you can drop privileges.
- jsjohnst 7y agoThese are containers, why on earth would you assume an app needs to run on a privileged port? You just run the app in the container on say 8080 or 8443 inside the container and expose it outside the container as 80 or 443 respectively.
- y4mi 7y agoHa, i literally forgot about that. Despite using docker every other day. Thanks for correcting me
- vhodges 7y agosudo apt-get install libcap2-bin # Debian/Ubuntu/etc sudo setcap 'cap_net_bind_service=+ep' /path/to/program will allow program to bind low numbered ports by non-root user. Just learned this deploying a new rails app behind caddy2 (which is running as the deploy user I setup).
- kissgyorgy 7y agoI'm not and what does it have to do with what I said? :) Do you know that nginx must be running as root, right?
- karlkeefer 7y agoIt's really useful (to me) to be able to split the api traffic and front-end traffic and the nginx configs make that really clear. Agree that it could be a lot smaller footprint, though, if I built front-end files into the golang app and had a single docker image that _did it all_ (besides the database).