-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
49 lines (33 loc) · 1.15 KB
/
Dockerfile
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
49
FROM python:3.10
RUN mkdir /postfix_saslquota/ -p && \
apt-get update && \
apt-get install -y --no-install-recommends net-tools ssl-cert && \
apt dist-upgrade -y && \
rm -rf /var/lib/apt/lists/*
RUN rm -f /etc/localtime && \
ln -fs /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
RUN chmod ugo+rx /etc/ssl/* -R
#RUN make-ssl-cert generate-default-snakeoil --force-overwrite
COPY /src/ /postfix_saslquota/
RUN useradd -ms /bin/bash www && \
chown www: /postfix_saslquota
USER www
WORKDIR /postfix_saslquota
ENV _bind=0.0.0.0 \
_bindport=10008 \
_bindtimeout=120 \
_myhost=mysql \
_myuser=saslquota \
_mypasswd=1a2b3c \
_mydb=saslquota \
_logfacility=mail \
_logaddress=localhost \
_logport=514 \
_loglevel=INFO \
_loghandler=stdout \
_quotafile=quotarules.json
RUN mv /postfix_saslquota/quotarules.json.orig /postfix_saslquota/quotarules.json
RUN pip3 install mysql-connector-python
HEALTHCHECK CMD netstat -an | grep ${_bindport} > /dev/null; if [ 0 != $? ]; then exit 1; fi;
#VOLUME ["/postfix_saslquota"]
CMD [ "python", "/postfix_saslquota/saslquota.py" ]