-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (38 loc) · 1.66 KB
/
Dockerfile
File metadata and controls
48 lines (38 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM debian:stretch
RUN export APP_DIR=$(pwd)
RUN mkdir /host/
COPY settings.sh /host/
### Update and upgrade and install some other packages.
RUN apt-get update && apt-get -y upgrade
RUN apt-get -y install apt-utils apt-transport-https apache2 && \
apt-get -y install rsyslog logrotate logwatch ssmtp wget whois \
dovecot-common sudo vim
### Install maria db
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install mariadb-client \
libmariadbclient-dev mariadb-common mariadb-server \
default-libmysqlclient-dev
### Start the mysql server && install some required packages
### noninteractive is required in order to avoid postfix prompts
RUN /etc/init.d/mysql start && \
DEBIAN_FRONTEND=noninteractive \
apt-get -y install \
build-essential git autotools-dev cdbs debhelper \
dh-autoreconf dpkg-dev gettext libev-dev libpcre3-dev \
libudns-dev pkg-config fakeroot phpmyadmin tor \
postfix postfix-pcre postfix-mysql apache2 bind9 systemd-sysv devscripts
### Run configuration scripts
COPY scripts/cfg/ /
COPY src/ /src
COPY dockercfg.sh /
COPY init.sh /
RUN chmod 775 dockercfg.sh init.sh && ./dockercfg.sh
### Give permission to anyone to run add-dovecot-user. This is needed because
### the script is executed from within PHP.
RUN echo 'www-data ALL=(ALL) NOPASSWD: /usr/lib/cgi-bin/add-dovecot-user.sh' | EDITOR='tee -a' visudo
### Setup Bind9 to use seperate logs
COPY scripts/bind/* /etc/bind/named.conf.log
RUN echo 'include "/etc/bind/named.conf.log";' >> /etc/bind/named.conf
RUN mkdir /var/log/bind && chown bind:bind /var/log/bind && \
service bind9 restart
CMD ./init.sh
EXPOSE 80 443 53 6565