Created
January 31, 2019 03:34
-
-
Save deargle/149b46ea67ac96a4efdab5f032391f6f to your computer and use it in GitHub Desktop.
nginx-proxy docker compose config file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
nginx: | |
image: nginx:1.14.2 | |
container_name: nginx-proxy | |
ports: | |
- "80:80" | |
- "443:443" | |
volumes: | |
- conf:/etc/nginx/conf.d | |
- vhost:/etc/nginx/vhost.d | |
- html:/usr/share/nginx/html | |
- certs:/etc/nginx/certs | |
labels: | |
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true" | |
dockergen: | |
image: jwilder/docker-gen:0.7.3 | |
container_name: nginx-proxy-gen | |
depends_on: | |
- nginx | |
command: -notify-sighup nginx-proxy -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf | |
volumes: | |
- conf:/etc/nginx/conf.d | |
- vhost:/etc/nginx/vhost.d | |
- html:/usr/share/nginx/html | |
- certs:/etc/nginx/certs | |
- /var/run/docker.sock:/tmp/docker.sock:ro | |
- ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro | |
letsencrypt: | |
image: jrcs/letsencrypt-nginx-proxy-companion | |
container_name: nginx-proxy-le | |
depends_on: | |
- nginx | |
- dockergen | |
environment: | |
NGINX_PROXY_CONTAINER: nginx-proxy | |
NGINX_DOCKER_GEN_CONTAINER: nginx-proxy-gen | |
volumes: | |
- conf:/etc/nginx/conf.d | |
- vhost:/etc/nginx/vhost.d | |
- html:/usr/share/nginx/html | |
- certs:/etc/nginx/certs | |
- /var/run/docker.sock:/var/run/docker.sock:ro | |
volumes: | |
conf: | |
vhost: | |
html: | |
certs: | |
# Do not forget to 'docker network create nginx-proxy' before launch, and to add '--network nginx-proxy' to proxied containers. | |
networks: | |
default: | |
external: | |
name: nginx-proxy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can't remember where I stole this from