Skip to content

Instantly share code, notes, and snippets.

@crisog
Forked from Layoric/nginx-reverse-proxy.yml
Created October 14, 2023 12:42
Show Gist options
  • Save crisog/e4aa40a6c7994661b623239ff311f096 to your computer and use it in GitHub Desktop.
Save crisog/e4aa40a6c7994661b623239ff311f096 to your computer and use it in GitHub Desktop.
Docker compose for Nginx Reverse Proxy and Lets Encrypt Companion
version: "3.9"
services:
nginx-proxy:
image: nginxproxy/nginx-proxy
container_name: nginx-proxy
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- conf:/etc/nginx/conf.d
- vhost:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- dhparam:/etc/nginx/dhparam
- certs:/etc/nginx/certs:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
labels:
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy"
letsencrypt:
image: nginxproxy/acme-companion:2.2
container_name: nginx-proxy-le
restart: always
depends_on:
- "nginx-proxy"
environment:
- [email protected]
volumes:
- certs:/etc/nginx/certs:rw
- acme:/etc/acme.sh
- vhost:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
default:
name: nginx
volumes:
conf:
vhost:
html:
dhparam:
certs:
acme:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment