Skip to content

Commit

Permalink
rename default network and create webroot docker volume
Browse files Browse the repository at this point in the history
  • Loading branch information
mrckndt committed Apr 16, 2021
1 parent ec9febc commit 794c3d2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
16 changes: 16 additions & 0 deletions contrib/systemd/certbot.service
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions contrib/systemd/certbot.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Description=Certbot certificate renew trigger

[Timer]
Persistent=true
OnCalendar=*-*-* 4:00:00

[Install]
WantedBy=timers.target
10 changes: 10 additions & 0 deletions docker-compose.nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 794c3d2

Please sign in to comment.