Skip to content

Instantly share code, notes, and snippets.

@nshtg
Created April 10, 2018 16:56
Show Gist options
  • Save nshtg/0a67f41a57ce4d825a061d0e738fcf7b to your computer and use it in GitHub Desktop.
Save nshtg/0a67f41a57ce4d825a061d0e738fcf7b to your computer and use it in GitHub Desktop.
Docker Compose nginx reverse proxy
version: '3'
services:
nginx-proxy:
image: jwilder/nginx-proxy:alpine
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./data/conf.d:/etc/nginx/conf.d
- ./data/vhost.d:/etc/nginx/vhost.d
- ./data/html:/usr/share/nginx/html
- ./data/certs:/etc/nginx/certs:ro
- ./data/htpasswd:/etc/nginx/htpasswd:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
logging:
options:
max-size: "4m"
max-file: "10"
nginx-letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: nginx-letsencrypt
restart: always
depends_on:
- nginx-proxy
volumes:
- ./data/conf.d:/etc/nginx/conf.d
- ./data/vhost.d:/etc/nginx/vhost.d
- ./data/html:/usr/share/nginx/html
- ./data/certs:/etc/nginx/certs:rw
- /var/run/docker.sock:/var/run/docker.sock:ro
logging:
options:
max-size: "2m"
max-file: "10"
networks:
default:
external:
name: webproxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment