Commit cfc84ebb authored by Ryan Herbert's avatar Ryan Herbert Committed by Mikaël Salson
Browse files

docker-compose.yml add postfix container

use catatnight/postfix image to provide a simple solution
for error notification emails

See #2760
parent 7528658c
......@@ -23,9 +23,12 @@ services:
condition: service_healthy
fuse:
condition: service_started
postfix:
condition: service_started
links:
- mysql:mysql
- fuse:fuse
- postfix:postfix
fuse:
image: vidjil/server:latest
command: bash /entrypoints/fuse-entrypoint.sh
......@@ -69,6 +72,7 @@ services:
condition: service_healthy
links:
- mysql
- postfix
backup:
image: vidjil/server:latest
command: bash -c "echo '0 5 * * * cd /usr/share/vidjil/server; sh backup.sh /mnt/backup 2>1&' > /etc/cron.d/backup-cron && cron && tail -f /var/log/cron.log"
......@@ -88,3 +92,12 @@ services:
condition: service_started
links:
- uwsgi:uwsgi
postfix:
image: catatnight/postfix
expose:
- 587
volumes:
- ./postfix/ssl:/etc/postfix/certs
environment:
- maildomain=vidjil.org
- smtp_user=vidjil:smtp_pass
from ubuntu:16.04
label version="1.0"
label description="An Ubuntu based docker image which postfix"
# Install Postfix. Shamelessly stolen from https://github.com/noteed/docker-postfix/blob/master/Dockerfile
run echo "postfix postfix/main_mailer_type string Internet site" > preseed.txt
run echo "postfix postfix/mailname string mail.example.com" >> preseed.txt
# Use Mailbox format.
run debconf-set-selections preseed.txt
run apt-get update
run DEBIAN_FRONTEND=noninteractive apt-get install -q -y postfix
run postconf -e myhostname=mail.example.com
run postconf -e mydestination="mail.example.com, example.com, localhost.localdomain, localhost"
run postconf -e mail_spool_directory="/var/spool/mail/"
run postconf -e mailbox_command=""
......@@ -4,7 +4,8 @@
###
### Email notifications for server errors
SMTP_SERVER = 'localhost'
SMTP_SERVER = 'postfix'
SMTP_CREDENTIALS = 'vidjil:smtp_pass' # set to None if no auth required
# SMTP_SERVER = 'logging' # no mail
FROM_EMAIL = 'notifications@vidjil.org'
ADMIN_EMAILS = ['notifications@vidjil.org']
......
......@@ -4,7 +4,8 @@
###
### Email notifications for server errors
SMTP_SERVER = 'localhost'
SMTP_SERVER = 'postfix'
SMTP_CREDENTIALS = 'vidjil:smtp_pass' # set to None if no auth required
# SMTP_SERVER = 'logging' # no mail
FROM_EMAIL = 'notifications@vidjil.org'
ADMIN_EMAILS = ['notifications@vidjil.org']
......
......@@ -88,7 +88,7 @@ auth.define_tables(username=False, signature=False)
mail = auth.settings.mailer
mail.settings.server = defs.SMTP_SERVER
mail.settings.sender = defs.FROM_EMAIL
mail.settings.login = None
mail.settings.login = defs.SMTP_CREDENTIALS
## configure auth policy
auth.settings.registration_requires_verification = False
......
......@@ -5,6 +5,7 @@
### Email notifications for server errors
SMTP_SERVER = 'localhost'
SMTP_CREDENTIALS = 'vidjil:XXXXXX' # set to None if no auth required
# SMTP_SERVER = 'logging' # no mail
FROM_EMAIL = 'root@vidjil.org'
ADMIN_EMAILS = ['notifications@vidjil.org']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment