Move to Docker Compose and multiple containers
parent
caab793716
commit
d0006dc624
@ -0,0 +1,12 @@
|
||||
FROM python:3
|
||||
|
||||
RUN mkdir -p /app
|
||||
WORKDIR /app
|
||||
|
||||
COPY freeposte ./freeposte
|
||||
COPY initdb.py .
|
||||
COPY requirements.txt .
|
||||
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
CMD gunicorn -w 4 -b 0.0.0.0:80 --access-logfile - --error-logfile - freeposte:app
|
@ -1,4 +1,4 @@
|
||||
Flask
|
||||
Flask-Admin
|
||||
Flask-SQLAlchemy
|
||||
uwsgi
|
||||
gunicorn
|
||||
|
@ -0,0 +1,3 @@
|
||||
FROM alpine
|
||||
|
||||
RUN apk add --update amavis spamassassin clamav && rm -rf /var/cache/apk/*
|
@ -1,39 +0,0 @@
|
||||
# service type private unpriv chroot wakeup maxproc command + args
|
||||
# (yes) (yes) (yes) (never) (100)
|
||||
|
||||
# Exposed SMTP services
|
||||
smtp inet n - - - - smtpd
|
||||
-o content_filter=spamassassin
|
||||
submission inet n - - - - smtpd
|
||||
-o smtpd_enforce_tls=yes
|
||||
-o smtpd_sasl_auth_enable=yes
|
||||
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
|
||||
smtps inet n - - - - smtpd
|
||||
-o smtpd_enforce_tls=yes
|
||||
-o smtpd_sasl_auth_enable=yes
|
||||
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
|
||||
|
||||
# Internal postfix services
|
||||
pickup fifo n - n 60 1 pickup
|
||||
cleanup unix n - - - 0 cleanup
|
||||
qmgr unix n - n 300 1 qmgr
|
||||
tlsmgr unix - - - 1000? 1 tlsmgr
|
||||
rewrite unix - - - - - trivial-rewrite
|
||||
bounce unix - - - - 0 bounce
|
||||
defer unix - - - - 0 bounce
|
||||
trace unix - - - - 0 bounce
|
||||
proxymap unix - - - - - proxymap
|
||||
verify unix - - - - 1 verify
|
||||
flush unix n - - 1000? 0 flush
|
||||
smtp unix - - - - - smtp
|
||||
relay unix - - - - - smtp
|
||||
error unix - - - - - error
|
||||
retry unix - - - - - error
|
||||
discard unix - - - - - discard
|
||||
lmtp unix - - - - - lmtp
|
||||
anvil unix - - - - 1 anvil
|
||||
scache unix - - - - 1 scache
|
||||
|
||||
# Utility services
|
||||
spamassassin unix - n n - - pipe
|
||||
user=nobody argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
|
@ -1,5 +0,0 @@
|
||||
$ModLoad imuxsock
|
||||
$ModLoad imklog
|
||||
|
||||
|
||||
*.* /data/logs/mail.log
|
@ -1,28 +0,0 @@
|
||||
[supervisord]
|
||||
nodaemon = true
|
||||
logfile = /data/logs/supervisord.log
|
||||
|
||||
[program:nginx]
|
||||
command = nginx -g 'daemon off;'
|
||||
|
||||
[program:rsyslog]
|
||||
command = rsyslogd -n
|
||||
|
||||
[program:postfix]
|
||||
command = /usr/lib/postfix/master -d
|
||||
|
||||
[program:dovecot]
|
||||
command = /usr/sbin/dovecot -c /etc/dovecot/dovecot.conf -F
|
||||
|
||||
[program:spamassassin]
|
||||
command = /usr/sbin/spamd
|
||||
|
||||
[program:admin]
|
||||
command = uwsgi --yaml /etc/uwsgi/apps-enabled/freeposte.yml
|
||||
stdout_logfile = /data/logs/admin.log
|
||||
stderr_logfile = /data/logs/admin-error.log
|
||||
|
||||
[program:webmail]
|
||||
command = php5-fpm -F
|
||||
stdout_logfile = /data/logs/php.log
|
||||
stderr_logfile = /data/logs/php-error.log
|
@ -1,16 +0,0 @@
|
||||
uwsgi:
|
||||
socket: /var/run/freeposte.sock
|
||||
chown-socket: www-data:www-data
|
||||
pidfile: /var/run/freeposte.pid
|
||||
master: true
|
||||
workers: 2
|
||||
|
||||
vacuum: true
|
||||
plugins: python
|
||||
wsgi-file: /admin/run.py
|
||||
callable: app
|
||||
processes: 1
|
||||
pythonpath: /usr/lib/python2.7/site-packages
|
||||
pythonpath: /admin
|
||||
catch-exceptions: true
|
||||
post-buffering: 8192
|
@ -0,0 +1,48 @@
|
||||
http:
|
||||
build: nginx
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
links:
|
||||
- admin
|
||||
- webmail
|
||||
volumes:
|
||||
- /tmp/data/certs:/certs
|
||||
|
||||
imap:
|
||||
build: dovecot
|
||||
ports:
|
||||
- "143:143"
|
||||
- "993:993"
|
||||
volumes:
|
||||
- /tmp/data/freeposte:/data
|
||||
- /tmp/data/mail:/mail
|
||||
- /tmp/data/certs:/certs
|
||||
|
||||
smtp:
|
||||
build: postfix
|
||||
ports:
|
||||
- "25:25"
|
||||
- "465:465"
|
||||
- "587:587"
|
||||
links:
|
||||
- imap
|
||||
volumes:
|
||||
- /tmp/data/freeposte:/data
|
||||
- /tmp/data/logs:/logs
|
||||
- /tmp/data/certs:/certs
|
||||
|
||||
admin:
|
||||
build: admin
|
||||
volumes:
|
||||
- /tmp/data/freeposte:/data
|
||||
environment:
|
||||
- DEBUG=True
|
||||
- SECRET_KEY=mysecretkey
|
||||
|
||||
webmail:
|
||||
build: roundcube
|
||||
links:
|
||||
- imap
|
||||
volumes:
|
||||
- /tmp/data/webmail:/data
|
@ -0,0 +1,17 @@
|
||||
FROM alpine
|
||||
|
||||
RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
||||
&& echo "@community http://dl-3.alpinelinux.org/alpine/edge/community/" >> /etc/apk/repositories \
|
||||
&& apk add --update \
|
||||
dovecot \
|
||||
dovecot-sqlite \
|
||||
dovecot-pigeonhole-plugin@community \
|
||||
dovecot-antispam-plugin@testing \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
COPY conf /etc/dovecot
|
||||
COPY sieve /var/lib/dovecot
|
||||
|
||||
COPY start.sh /start.sh
|
||||
|
||||
CMD ["/start.sh"]
|
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Fix permissions
|
||||
chown -R mail:mail /mail
|
||||
chown -R mail:mail /var/lib/dovecot
|
||||
|
||||
# Run dovecot
|
||||
exec /usr/sbin/dovecot -c /etc/dovecot/dovecot.conf -F
|
@ -0,0 +1,3 @@
|
||||
FROM nginx
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
@ -0,0 +1,10 @@
|
||||
FROM alpine
|
||||
|
||||
RUN apk add --update postfix postfix-sqlite rsyslog && rm -rf /var/cache/apk/*
|
||||
|
||||
COPY conf /etc/postfix
|
||||
COPY rsyslog.conf /etc/rsyslog.conf
|
||||
|
||||
COPY start.sh /start.sh
|
||||
|
||||
CMD ["/start.sh"]
|
@ -0,0 +1,34 @@
|
||||
# service type private unpriv chroot wakeup maxproc command + args
|
||||
# (yes) (yes) (yes) (never) (100)
|
||||
|
||||
# Exposed SMTP services
|
||||
smtp inet n - n - - smtpd
|
||||
submission inet n - n - - smtpd
|
||||
-o smtpd_enforce_tls=yes
|
||||
-o smtpd_sasl_auth_enable=yes
|
||||
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
|
||||
smtps inet n - n - - smtpd
|
||||
-o smtpd_enforce_tls=yes
|
||||
-o smtpd_sasl_auth_enable=yes
|
||||
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
|
||||
|
||||
# Internal postfix services
|
||||
pickup unix n - n 60 1 pickup
|
||||
cleanup unix n - n - 0 cleanup
|
||||
qmgr unix n - n 300 1 qmgr
|
||||
tlsmgr unix - - n 1000? 1 tlsmgr
|
||||
rewrite unix - - n - - trivial-rewrite
|
||||
bounce unix - - n - 0 bounce
|
||||
defer unix - - n - 0 bounce
|
||||
trace unix - - n - 0 bounce
|
||||
verify unix - - n - 1 verify
|
||||
flush unix n - n 1000? 0 flush
|
||||
proxymap unix - - n - - proxymap
|
||||
smtp unix - - n - - smtp
|
||||
relay unix - - n - - smtp
|
||||
error unix - - n - - error
|
||||
retry unix - - n - - error
|
||||
discard unix - - n - - discard
|
||||
lmtp unix - - n - - lmtp
|
||||
anvil unix - - n - 1 anvil
|
||||
scache unix - - n - 1 scache
|
@ -0,0 +1,4 @@
|
||||
$ModLoad imuxsock
|
||||
$template noTimestampFormat,"%syslogtag%%msg%\n"
|
||||
$ActionFileDefaultTemplate noTimestampFormat
|
||||
*.*;auth,authpriv.none /dev/stdout
|
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/lib/postfix/master &
|
||||
rsyslogd -n
|
@ -0,0 +1,28 @@
|
||||
FROM php:apache
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libfreetype6-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libmcrypt-dev \
|
||||
libpng12-dev \
|
||||
&& docker-php-ext-install pdo_mysql mcrypt
|
||||
|
||||
ENV ROUNDCUBE_URL https://downloads.sourceforge.net/project/roundcubemail/roundcubemail/1.1.4/roundcubemail-1.1.4-complete.tar.gz
|
||||
|
||||
RUN echo date.timezone=UTC > /usr/local/etc/php/conf.d/timezone.ini
|
||||
|
||||
RUN cd /tmp \
|
||||
&& curl -L -O ${ROUNDCUBE_URL} \
|
||||
&& tar -xf *.tar.gz \
|
||||
&& rm -f *.tar.gz \
|
||||
&& rm -rf /var/www/html \
|
||||
&& mv roundcubemail-* /var/www/html \
|
||||
&& cd /var/www/html \
|
||||
&& rm -rf CHANGELOG INSTALL LICENSE README.md UPGRADING composer.json-dist installer \
|
||||
&& chown -R www-data: logs
|
||||
|
||||
COPY config.inc.php /var/www/html/config/
|
||||
|
||||
COPY start.sh /start.sh
|
||||
|
||||
CMD ["/start.sh"]
|
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Fix some permissions
|
||||
chown -R www-data:www-data /data
|
||||
|
||||
# Run apache
|
||||
exec apache2-foreground
|
Loading…
Reference in New Issue