forked from catatnight/docker-postfix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (40 loc) · 1.52 KB
/
Dockerfile
File metadata and controls
48 lines (40 loc) · 1.52 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
FROM ubuntu:latest
MAINTAINER Alex Noel
# Set noninteractive mode for apt-get
ENV DEBIAN_FRONTEND noninteractive
# Update
RUN apt-get update
RUN apt-get install -y python3
# Check OS type and install packages accordingly
RUN if grep "ubuntu" /etc/os-release > /dev/null ; then \
apt-get -y install supervisor postfix sasl2-bin opendkim opendkim-tools; \
elif grep "redhat" /etc/os-release > /dev/null ; then \
yum -y update && \
yum -y install epel-release && \
yum -y install supervisor postfix cyrus-sasl cyrus-sasl-plain opendkim opendkim-tools ; \
elif grep -i "rocky" /etc/os-release > /dev/null ; then \
yum -y update && \
yum -y install epel-release && \
yum -y install supervisor postfix cyrus-sasl cyrus-sasl-plain opendkim opendkim-tools ; \
elif grep "solaris" /etc/release > /dev/null ; then \
pkg update -y && \
pkg install -y supervisor postfix sasl opendkim ; \
fi
# Add files
ADD assets/install.sh /opt/install.sh
ADD assets/update-firewall.sh /opt/update-firewall.sh
ADD assets/export.bash /opt/SMTPINFO.bash
add assets/creds.py /opt/creds.py
ADD assets/build.py /opt/build.py
# Set executable permissions
RUN chmod +x /opt/update-firewall.sh
RUN chmod +x /opt/build.py
RUN chmod +x /opt/SMTPINFO.bash
RUN chmod +x /opt/creds.py
# Run
CMD /opt/install.sh && \
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf && \
/opt/update-firewall.sh && \
source /opt/SMTPINFO.bash && \
python /opt/build.py && \
rm /opt/export.bash