Skip to content

Instantly share code, notes, and snippets.

@wilcorrea
Last active November 24, 2020 19:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wilcorrea/903691dc54697f689fea9b9a2963b5f5 to your computer and use it in GitHub Desktop.
Save wilcorrea/903691dc54697f689fea9b9a2963b5f5 to your computer and use it in GitHub Desktop.
Docker Compose para manter
version: '3.7'
# make sure everything is running with:
# docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}\t{{.Status}}" | grep "nginx-"
#networks
networks:
#network reverse-proxy
reverse-proxy:
external: true
name: reverse-proxy
#services
services:
#service nginx-proxy
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
restart: unless-stopped
networks:
- reverse-proxy
volumes:
- $HOME/certs:/etc/nginx/certs:ro
- /etc/nginx/vhost.d:/etc/nginx/vhost.d
- /usr/share/nginx/html:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
ports:
- 80:80
- 443:443
#service nginx-letsencrypt
nginx-letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: nginx-letsencrypt
restart: unless-stopped
depends_on:
- nginx-proxy
networks:
- reverse-proxy
volumes:
- $HOME/certs:/etc/nginx/certs:rw
- /etc/nginx/vhost.d:/etc/nginx/vhost.d
- /usr/share/nginx/html:/usr/share/nginx/html
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- NGINX_PROXY_CONTAINER=nginx-proxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment