docker-compose.yml
files I use to setup these stacks.
version: '3.3'
services:
nginx:
image: nginx:latest
environment:
VIRTUAL_HOST: example.com
ports:
- 30001:80
networks:
- default
logging:
driver: json-file
networks:
default:
driver: overlay
This is my docker-compose.yml
as it gets set up after I load in my stuff. It basically adds the default network in there for me
0
ports
, and run the default
network which is already in overlay mode.
ports: - 80:80
80:80
, it becomes available to the entire world and docker swarm, instead of just in this network that I was expecting to be routing to
docker-compose.yml
from anywhere with a web app; you may assume a port 80
is bound somewhere. However, if there's already another stack that uses it, this won't work. This seems weird to me, as I understand that you'd have to route to that specific virtual network in your swarm (hence; the reverse proxy). But I wasn't expecting it to be swarm wide when you expose a port.
test_default
, test2_default
(being appA and appB)
port 80
assignment in there.
port 80:80
, but have it randomize instead so your proxy can take port 80:80