Browse Source

Run certbot on startup

master
parent
commit
e2f2220b5d
2 changed files with 9 additions and 0 deletions
  1. 1
    0
      Dockerfile
  2. 8
    0
      haraka.sh

+ 1
- 0
Dockerfile View File

@@ -36,5 +36,6 @@ RUN npm -g install Haraka \
EXPOSE 25 80 587

VOLUME /haraka
VOLUME /etc/letsencrypt

ENTRYPOINT ["/usr/bin/supervisord"]

+ 8
- 0
haraka.sh View File

@@ -8,4 +8,12 @@ fi
# Specify hostname
echo $HOSTNAME > /haraka/config/me

# Get and install certificates from Let's Encrypt
certbot certonly -n --agree-tos -d "$HOSTNAME"
mkdir -p /haraka/config/tls
cd /haraka/config/tls
ln -s /etc/letsencrypt/live/$HOSTNAME/privkey.pem tls-key.pem
ln -s /etc/letsencrypt/live/$HOSTNAME/fullchain.pem tls-cert.pem
cd -

haraka -c /haraka

Loading…
Cancel
Save