Usage:
docker run -d
--name d-nginx
-p 80:80 -p 443:443
--mount type=bind,source=/var/www,target=/var/www
--mount type=bind,source=/etc/letsencrypt,target=/etc/letsencrypt
--mount type=volume,source=nginx-settings,target=/etc/nginx
integralik/nginx
Now nginx can listen to ports 80 and 443, use folder /var/www for files and save settings from interior /etc/nginx in volume nginx-settings.
Also you can send the commands straight by name: docker exec -it d-nginx service nginx status
By default nginx listens to all domains on port 80 and does not listen on port 443. All of them have /var/www/html as root (as mentioned in /etc/nginx/sites-available/default). There is a command "addhostn domain.xyz" which adds such host and restarts the server. Do it after you received the ssl-certificate with certbot. The host listens to the domain.xyz on port 80 and 443. Port 80 (only for this domain) is redirected to 443. The certificate is already installed.
Content type
Image
Digest
Size
118.4 MB
Last updated
about 6 years ago
docker pull integralik/nginx