Nginx Proxy
Works with Docker Compose v2.
Compose file
services:
whoami:
image: jwilder/whoami
environment:
- VIRTUAL_HOST=whoami.example.com
nginx-proxy:
image: nginxproxy/nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
Steps
-
Change domain in
docker-compose.yml
to a domain pointing to your server -
Start all services
docker-compose up -d
-
Change
whoami
image to, for example,traefik/whoami
. -
Deploy a new version of
whoami
service without downtime.docker rollout whoami