I am using the swag container to host a website. Now I want to add another domain to this host.
- I have added the domain configuration to /var/lib/docker/volumes/swag/_data/nginx/site-confs
- And created the website folder in /var/lib/docker/volumes/swag/_data/www/$newdomain/html
- I have also created an index.html file and I can see it’s contents when browsing to www.$newdomain.com
Is there a way to generate a certificate for this domain, without deleting and re-creating the container?
I tried this
docker exec \
swag \
certbot certonly \
--pre-hook "pkill -9 -ef nginx" \
--standalone \
--non-interactive \
--agree-tos \
--redirect \
-m $emailaddress \
-d $domain \
-d www.$domain \
--post-hook "exec /usr/sbin/nginx -c /config/nginx/nginx.conf"
I didn’t get any errors but the certificate was not generated.
I was hoping there might be a Docker Mod that might allow me to do this but I don’t know if that’s what they were meant to do.
Is there a way to generate a certificate for this domain, without deleting and re-creating the container?