proxy/certbot-runner
2025-06-18 17:16:13 +00:00

20 lines
572 B
Bash
Executable file

#!/bin/bash
# Define variables
CONTAINER_NAME="certbot"
IMAGE_NAME="legacy-registry.sexycoders.org/proxy:latest"
LETSENCRYPT_DIR="./letsencrypt"
# Stop and remove the container if it's already running
if docker ps -a | grep -q $CONTAINER_NAME; then
echo "Stopping and removing existing container..."
docker rm -f $CONTAINER_NAME
fi
# Run the container interactively with auto-remove
echo "Starting container with letsencrypt directory bound..."
docker run --rm -it \
--name $CONTAINER_NAME \
-v $LETSENCRYPT_DIR:/etc/letsencrypt \
$IMAGE_NAME bash