Last active
July 2, 2021 07:57
-
-
Save deskoh/e47d414a02c046f53d1b3ad628745aff to your computer and use it in GitHub Desktop.
Auto NGINX Proxy for Docker Environments
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.1' | |
services: | |
nginx-proxy: | |
image: jwilder/nginx-proxy:alpine | |
restart: unless-stopped | |
environment: | |
# Disable redirect and HSTS | |
HTTPS_METHOD: noredirect | |
# Disable Diffie-Hellman parameters | |
DHPARAM_GENERATION: "false" | |
ports: | |
- "80:80" | |
- "443:443" | |
volumes: | |
- /var/run/docker.sock:/tmp/docker.sock:ro | |
- ./certs:/etc/nginx/certs | |
nginx: | |
image: nginx:alpine | |
restart: unless-stopped | |
environment: | |
VIRTUAL_HOST: nginx.127.0.0.1.nip.io | |
# VIRTUAL_PORT: 80 | |
# Use `server.crt` and `server.key` in `./certs` directory for SSL | |
CERT_NAME: server | |
deploy: | |
replicas: 2 | |
resources: | |
limits: | |
cpus: '1' | |
expose: | |
- 80 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment