init mailu-deploy-letsencrypt

This commit is contained in:
2021-04-05 12:32:55 +02:00
parent ff527e326b
commit dfc737dfc8
6 changed files with 34 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
[Unit]
Description=Let's Encrypt Mailu Deploy
OnFailure=systemd-email@%n.service
After=nginx.service
[Service]
Type=oneshot
ExecStart=/usr/bin/bash /usr/local/bin/mailu/deploy-letsencrypt-mailu.sh

View File

@@ -0,0 +1,5 @@
#!/bin/sh
cp /etc/letsencrypt/live/{{domain}}/privkey.pem /etc/mailu/certs/key.pem || exit 1
cp /etc/letsencrypt/live/{{domain}}/fullchain.pem /etc/mailu/certs/cert.pem || exit 1
sudo cp /etc/letsencrypt/live/{{domain}} /etc/mailu/letsencrypt/ || exit 1
docker exec mailu_front_1 nginx -s reload

View File

@@ -37,9 +37,8 @@ services:
- "{{ ip4_address }}:143:143"
- "{{ ip4_address }}:993:993"
volumes:
- "/etc/letsencrypt:/certs/letsencrypt:ro"
- "/etc/mailu/overrides/nginx:/overrides"
- "front_certs:/certs"
- "/etc/mailu/certs:/certs"
admin:
image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}admin:${MAILU_VERSION:-1.8}
restart: always