Skip to content

Instantly share code, notes, and snippets.

@simonegiacomelli
Created May 30, 2020 16:33
Show Gist options
  • Save simonegiacomelli/b36ebf04aed8e7d2cf0e3471a5b76ebe to your computer and use it in GitHub Desktop.
Save simonegiacomelli/b36ebf04aed8e7d2cf0e3471a5b76ebe to your computer and use it in GitHub Desktop.
version: "3"
services:
web:
image: example/website
expose:
- 8000
environment:
HTTP_PORT: 8000
VIRTUAL_HOST: www.example.com
LETSENCRYPT_HOST: www.example.com
LETSENCRYPT_EMAIL: "example@example.com"
networks:
service_network:
web-redirect:
image: adamkdean/redirect
environment:
VIRTUAL_HOST: example.com
LETSENCRYPT_HOST: example.com
LETSENCRYPT_EMAIL: "example@example.com"
REDIRECT_LOCATION: "https://www.example.com"
networks:
service_network:
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- 80:80
- 443:443
container_name: nginx-proxy
networks:
service_network:
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- nginx-certs:/etc/nginx/certs
- nginx-vhost:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
nginx-proxy-letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
environment:
NGINX_PROXY_CONTAINER: "nginx-proxy"
networks:
service_network:
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- nginx-certs:/etc/nginx/certs
- nginx-vhost:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
networks:
service_network:
volumes:
nginx-certs:
nginx-vhost:
nginx-html:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment