4 ms·
Very good point, I didn't know this almost got burned by this while learning Docker. What I did was use shared network (for private db connection etc) in a dock
by adamddev1 5y ago
Very good point, I didn't know this almost got burned by this while learning Docker. What I did was use shared network (for private db connection etc) in a docker-compose file, and then expose the port I wanted to reverse proxy out on by
ports:
- 127.0.0.1:3000:3000
This way it only exposes it to the local host on the machine without exposing it on the firewall. Then I reverse proxied out port 3000 with NGINX to the outside world. I'm surprised this isn't talked about more in beginner tutorials etc.