Add SSL setup script for Dockerized Nginx with Let's Encrypt#745
Add SSL setup script for Dockerized Nginx with Let's Encrypt#745udkumar wants to merge 6 commits intoBridgeconn:version-2from
Conversation
kavitharaju
left a comment
There was a problem hiding this comment.
In our existing setup we have nginx and certbot as docker services and we avoid installing them directly on the host machine. Please update this script to work with the docker services.
How/when to run this shell script? Please document necessary details.
|
I'm currently utilising Docker services exclusively and not using Nginx on the host. I've automated the manual processes with a single shell script, which accomplishes the following tasks:
|
|
@kavitharaju
|
| fi | ||
|
|
||
| # Configuration variables | ||
| NGINX_CONTAINER_NAME="docker-web-server-with-cert-1" |
There was a problem hiding this comment.
Is there a way to not hardcode this and get this from the env?
There was a problem hiding this comment.
This we can take from env for sure
| generate_certificates() { | ||
| echo "Generating SSL certificates for $DOMAIN..." | ||
|
|
||
| docker run --rm -it \ |
There was a problem hiding this comment.
So does this run docker within docker?
There was a problem hiding this comment.
Yes, I also checked that the current approach isn't ideal. If it's not suitable, I'm working on creating a single Docker solution, though it's taking some time.
After your comment, I tried but I am getting the same issue as certificate not creating.
| entrypoint: /bin/sh -c ' | ||
| while :; do | ||
| /auto_ssl_script.sh; | ||
| sleep 80d; |
There was a problem hiding this comment.
Is there a way to use the ofelia-scheduler which is already used for scheduled backups for this task?
This commit introduces a new shell script for setting up and managing a Dockerised Nginx environment. Key features include:
The script is intended to streamline the deployment and maintenance of secure Nginx setups in Docker environments.