proxy/certbot-runner

21 lines
572 B
Text
Raw Normal View History

2025-06-18 17:16:13 +00:00
#!/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