Skip to content

Commit e3397fd

Browse files
authored
feature(deployment): support google-dns with certbot (#1)
1 parent 72cdada commit e3397fd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

deployment/docker_compose/docker-compose.prod.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ services:
254254

255255
# follows https://pentacent.medium.com/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71
256256
certbot:
257-
image: certbot/certbot
257+
image: "${CERTBOT_IMAGE:-certbot/certbot}" # Allows overriding the image for specific certbot variants (e.g., certbot/dns-google)
258+
network_mode: ${CERTBOT_NETWORK_MODE:-bridge} # Allows setting the network mode, defaulting to bridge (e.g., 'host' to allow gcp instances to access the compute metadata server for auth)
258259
restart: unless-stopped
259260
volumes:
260261
- ../data/certbot/conf:/etc/letsencrypt

deployment/docker_compose/init-letsencrypt.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,12 @@ esac
102102
# Enable staging mode if needed
103103
if [ $staging != "0" ]; then staging_arg="--staging"; fi
104104

105+
# Allows configuration of certbot auth method. Set default to webroot if not specified
106+
certbot_auth_args=${CERTBOT_AUTH_ARGS:-"--webroot -w /var/www/certbot"}
107+
105108
$COMPOSE_CMD -f docker-compose.prod.yml run --name onyx-stack --rm --entrypoint "\
106-
certbot certonly --webroot -w /var/www/certbot \
109+
certbot certonly \
110+
$certbot_auth_args \
107111
$staging_arg \
108112
$email_arg \
109113
$domain_args \

0 commit comments

Comments
 (0)