Usage of .env; hosts_append in start.sh

This commit is contained in:
Bandie 2021-01-13 19:09:26 +01:00
parent 6fff0a53a1
commit 7483233c33
Signed by: Bandie
GPG Key ID: 843D7FA93BA46312
5 changed files with 26 additions and 11 deletions

13
.env-example Normal file
View File

@ -0,0 +1,13 @@
DOMAIN_NAME=bla.domain.tld
SMTP_HOST=mail.domain.tld
SMTP_PORT=587
SMTP_FROM=gitea@domain.tld
SMTP_USER=gitea@domain.tld
SMTP_PASSWORD=
SMTP_ENCRYPTION=starttls
SECRET_KEY=averybigsecretapikey
RECIPIENTS_PR='mail@domain.tld','mail2@domain.tld'

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.env

View File

@ -25,7 +25,6 @@ COPY configs/msmtprc /etc/msmtprc
COPY configs/aliases /etc/aliases COPY configs/aliases /etc/aliases
COPY configs/hosts /etc/hosts_append COPY configs/hosts /etc/hosts_append
RUN cat /etc/hosts_append >> /etc/hosts
COPY start.sh /start.sh COPY start.sh /start.sh
RUN chmod +x /start.sh RUN chmod +x /start.sh

View File

@ -5,18 +5,18 @@ services:
build: . build: .
restart: always restart: always
environment: environment:
- SMTP_HOST= - SMTP_HOST=${SMTP_HOST}
- SMTP_PORT= - SMTP_PORT=${SMTP_PORT}
- SMTP_FROM= - SMTP_FROM=${SMTP_FROM}
- SMTP_USER= - SMTP_USER=${SMTP_USER}
- SMTP_PASSWORD= - SMTP_PASSWORD=${SMTP_PASSWORD}
- SMTP_ENCRYPTION= - SMTP_ENCRYPTION=${SMTP_ENCRYPTION}
- SECRET_KEY= - SECRET_KEY=${SECRET_KEY}
- RECIPIENTS_PR= - RECIPIENTS_PR=${RECIPIENTS_PR}
- DOMAIN_NAME=webhooks.chaospott.de - DOMAIN_NAME=${DOMAIN_NAME}
labels: labels:
- traefik.enable=true - traefik.enable=true
- traefik.frontend.rule=Host:webhooks.chaospott.de - traefik.frontend.rule=Host:${DOMAIN_NAME}
- traefik.port=80 - traefik.port=80
- traefik.docker.network=web - traefik.docker.network=web
networks: networks:

View File

@ -24,6 +24,8 @@ sed -i "s/%%SECRETKEY%%/$SECRET_KEY/g;s/%%RECIPIENTS_PR%%/$RECIPIENTS_PR/g;s/%%S
sed -i "s/%%DOMAIN_NAME%%/$DOMAIN_NAME/g" /etc/nginx/nginx.conf sed -i "s/%%DOMAIN_NAME%%/$DOMAIN_NAME/g" /etc/nginx/nginx.conf
cat /etc/hosts_append >> /etc/hosts
chown www:www /var/log/nginx/* chown www:www /var/log/nginx/*
ln -sf /usr/bin/msmtp /usr/sbin/sendmail ln -sf /usr/bin/msmtp /usr/sbin/sendmail