docker-compose
Start with docker-compose
May users deploy their docker containers using docker-compose. In these circumstances using the Nginx-LE cli tools may not be appropriate.
This is the case for most production systems, in which case you will just use the standard docker management tools.
Whilst it can be useful to run nginx-le config,
it is not required and for most users won't be needed.
If you want to use any of the nginx-le commands you MUST first run:
docker-compose up
at least oncenginx-le config
.
Note: If you do use nginx-le config
then if you change your dock-compose configuration, docker-compose will recreate the container. When this occurs you MUST re-run nginx-le config
and select the new container.
To start Nginx-LE with docker-compose you must provide a number of configuration settings:
The following is a sample configuration:
The environment variables for the Auth Provider will change based on which Auth Provider you have selected.
Volumes
The certificates
volume is used to store the certbot certificates between restarts. The /opt/nginx/include
host path is where you place the nginx .location
and .upstream
includes.
Acquire a certificate
If you set the environment variable AUTO_ACQUIRE=true then Nginx-LE will automatically acquire and renew certificates as required.
If you don't pass the AUTO_ACQUIRE environment variable or set it to false than you must manually acquire a certificate (using nginx-le acquire).
We strongly recommend using AUTO_ACQUIRE and don't know of any valid reason why you would not.
Last updated