rename default network and create webroot docker volume

This commit is contained in:
Marco Kundt 2021-04-16 11:26:33 +02:00
parent ec9febc868
commit 794c3d2f67
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,16 @@
[Unit]
Description=Certbot certificate renew trigger
After=network-online.target
Wants=network-online.target
[Service]
Environment="VOLUME_ROOT=/home/admin/mattermost-docker"
Type=oneshot
ExecStart=/usr/bin/docker run --rm --name certbot --network mattermost \
-v '${VOLUME_ROOT}/certs/etc/letsencrypt:/etc/letsencrypt' \
-v '${VOLUME_ROOT}/certs/var/lib/letsencrypt:/var/lib/letsencrypt' \
-v shared-webroot:/webroot \
certbot/certbot renew --webroot-path /webroot
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,9 @@
[Unit]
Description=Certbot certificate renew trigger
[Timer]
Persistent=true
OnCalendar=*-*-* 4:00:00
[Install]
WantedBy=timers.target

View File

@ -10,9 +10,19 @@ services:
- ${NGINX_DHPARAMS_FILE}:/dhparams4096.pem
- ${CERT_PATH}:/cert.pem:ro
- ${KEY_PATH}:/key.pem:ro
- shared-webroot:/usr/share/nginx/html
environment:
# timezone inside container
- TZ
ports:
- ${HTTPS_PORT}:443
- ${HTTP_PORT}:80
# Shared volume for Let's Encrypt certificate renewal with a webroot
volumes:
shared-webroot:
# This network name is being used for Let's Encrypt certificate renewal
networks:
default:
name: mattermost