- Notifications
You must be signed in to change notification settings - Fork3.1k
Docker Compose Example
Nicolas Duchon edited this pageDec 8, 2024 ·3 revisions
Create docker network, which is going to be used by proxy and proxied servers.
docker network create proxy-net
Example ofdocker-compose.yaml
services:proxy:container_name:proxyimage:nginxproxy/nginx-proxyports: -80:80 -443:443volumes: -/var/run/docker.sock:/tmp/docker.sock:roenvironment: -TRUST_DOWNSTREAM_PROXY=false# true if there is another proxy in front of this onenetworks: -proxy-net# proxy and all proxied servers have to be on the same networkproxied_server1:image:your_image:latestenvironment: -VIRTUAL_HOST=your.domain.com -VIRTUAL_PORT=3000# the same port as in exposeexpose: -3000# port your app uses to communicatedepends_on: -proxynetworks: -proxy-netnetworks:proxy-net:name:proxy-netexternal:true