Setup a roundcube Webmail
parent
bb0e972321
commit
16f30813c9
@ -1,25 +1,40 @@
|
||||
FROM python:3
|
||||
|
||||
# Install required system packages
|
||||
RUN export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
postfix dovecot-imapd dovecot-sqlite dovecot-lmtpd \
|
||||
dovecot-sieve dovecot-managesieved \
|
||||
dovecot-antispam spamassassin spamc clamav \
|
||||
php5-fpm php5-mysql php5-imap php5-sqlite \
|
||||
supervisor rsyslog nginx \
|
||||
&& apt-get clean
|
||||
|
||||
# When installed non-interactively, the file does not get copied to the
|
||||
# postfix chroot, thus causing smtpd to fail.
|
||||
RUN cp /etc/services /var/spool/postfix/etc/
|
||||
# Install the Webmail from source
|
||||
ENV ROUNDCUBE_VERSION 1.1.4-complete
|
||||
RUN curl -L -O https://downloads.sourceforge.net/project/roundcubemail/roundcubemail/1.1.4/roundcubemail-${ROUNDCUBE_VERSION}.tar.gz \
|
||||
&& tar -xf roundcubemail-${ROUNDCUBE_VERSION}.tar.gz \
|
||||
&& rm -f roundcubemail-${ROUNDCUBE_VERSION}.tar.gz \
|
||||
&& mv roundcubemail-* /webmail
|
||||
|
||||
# Install the Web admin panel
|
||||
COPY admin /admin
|
||||
RUN pip install -r /admin/requirements.txt
|
||||
|
||||
# Configure the webmail
|
||||
RUN cd /webmail \
|
||||
&& rm -rf CHANGELOG INSTALL LICENSE README.md UPDGRADING composer.json-dist temp logs \
|
||||
&& ln -s /data/logs/webmail logs \
|
||||
&& ln -s /data/webmail/temp temp \
|
||||
&& ln -s /etc/roundcube.inc.php config/config.inc.php
|
||||
|
||||
# Load the configuration
|
||||
COPY config /etc/
|
||||
|
||||
# Copy the entrypoint
|
||||
COPY start.sh /start.sh
|
||||
|
||||
# Explicitely specify the configuration file to avoid problems when
|
||||
# the default configuration path changes.
|
||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||
CMD "/start.sh"
|
||||
|
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
$config = array();
|
||||
|
||||
$config['db_dsnw'] = 'sqlite:////data/webmail/roundcube.db';
|
||||
$config['default_host'] = 'localhost';
|
||||
$config['smtp_server'] = 'localhost';
|
||||
$config['smtp_port'] = 25;
|
||||
$config['des_key'] = 'rcmail-!24ByteDESkey*Str';
|
||||
|
||||
// List of active plugins (in plugins/ directory)
|
||||
$config['plugins'] = array(
|
||||
'archive',
|
||||
'zipdownload',
|
||||
);
|
||||
|
||||
// skin name: folder from skins/
|
||||
$config['skin'] = 'larry';
|
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
# When postfix is installed non-interactively, the file does not get copied to
|
||||
# the postfix chroot, thus causing smtpd to fail, fix this at runtime
|
||||
cp /etc/services /var/spool/postfix/etc/
|
||||
|
||||
# Fix permissions inside data and create necessary directories if not already
|
||||
# present
|
||||
mkdir -p \
|
||||
/data/mail \
|
||||
/data/webmail/tmp \
|
||||
/data/logs \
|
||||
/data/ssl
|
||||
|
||||
chown -R mail:mail /data/mail
|
||||
chown -R www-data:www-data /data/webmail /data/logs/webmail
|
||||
|
||||
# Copy the system snakeoil certificate if none is provided
|
||||
if [ ! -f /data/ssl/cert.pem ]; then
|
||||
cp /etc/ssl/private/ssl-cert-snakeoil.key /data/ssl/key.pem
|
||||
cp /etc/ssl/certs/ssl-cert-snakeoil.pem /data/ssl/cert.pem
|
||||
fi
|
||||
|
||||
# Finally run the server
|
||||
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
Loading…
Reference in New Issue