Skip to content

Instantly share code, notes, and snippets.

@clairmont32
Last active February 15, 2021 20:15
Show Gist options
  • Save clairmont32/1134f8fc1f556d6c1284d9597815e5cc to your computer and use it in GitHub Desktop.
Save clairmont32/1134f8fc1f556d6c1284d9597815e5cc to your computer and use it in GitHub Desktop.
Nginx Proxy with Multiple Web Services
version: "3.9"
services:
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
staging:
image: httpd
ports:
- 80
volumes:
- ./staging:/usr/local/apache2/htdocs
environment:
- "VIRTUAL_HOST=staging.localhost"
dev:
image: httpd
ports:
- 80
volumes:
- ./dev:/usr/local/apache2/htdocs
environment:
- "VIRTUAL_HOST=dev.localhost"
prod:
image: httpd
ports:
- 80
volumes:
- ./prod:/usr/local/apache2/htdocs
environment:
- "VIRTUAL_HOST=prod.localhost"
networks:
default:
external:
name: nginx-proxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment