Set up nginx-proxy with letsencrypt-nginx-proxy-companion
Create a unique network for nginx-proxy and other Docker containers to communicate through.
docker network create nginx-proxy
Clone this repository.
git clone [email protected]:evgeny-golubev/docker-nginx-proxy-with-lets-encrypt
Now run the docker-compose command.
cd docker-nginx-proxy-with-lets-encrypt && docker-compose up -d
In your container you must configure the following:
- Three environment variables:
VIRTUAL_HOST
,VIRTUAL_PORT
(80 by default),LETSENCRYPT_HOST
,LETSENCRYPT_EMAIL
environment:
VIRTUAL_HOST: example.com
VIRTUAL_PORT: 80
LETSENCRYPT_HOST: example.com
LETSENCRYPT_EMAIL: [email protected]
- Exposing port 80 or change VIRTUAL_PORT if other
expose:
- 80
- The Docker network:
nginx-proxy
networks:
default:
external:
name: nginx-proxy