Created
July 28, 2023 03:06
-
-
Save Layoric/ccf909f147bb7b3e349f87cdc56a94b8 to your computer and use it in GitHub Desktop.
Docker compose for Nginx Reverse Proxy and Lets Encrypt Companion
This file contains hidden or 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.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
To use this with your custom
docker-compose.yml
application, you will need to also join the samenginx
network with the following.