-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
46 lines (33 loc) · 1.09 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
FROM python:3.11-slim
ENV PYTHONPATH "/app"
EXPOSE 80 25 587
# Install dependencies
ARG DEBIAN_FRONTEND=noninteractive
RUN echo "postfix postfix/mailname string ${MAIL_DOMAIN}" | debconf-set-selections && \
echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections
RUN apt-get update \
&& apt-get -y install libpq-dev gcc \
&& apt install python3 python3-pip gunicorn3 gnupg2 postfix postfix-pgsql postfix-policyd-spf-python opendkim opendkim-tools dnsutils procps -y \
&& pip install psycopg2
# Create gnupg path
RUN mkdir ~/.gnupg
RUN mkdir /app
RUN mkdir /tutorial
WORKDIR /app
# Install poetry
RUN pip3 install poetry
COPY pyproject.toml /app
# Install dependencies
RUN poetry install --only main --no-interaction --no-ansi
# Copy code
COPY . .
COPY server-entrypoint.sh .
COPY setup-postfix.sh .
COPY maid.py .
COPY maid-jobs.txt .
COPY email_handler.py .
# Force key generation on first run
RUN rm /etc/ssl/certs/ssl-cert-snakeoil.pem
# Config Postfix
RUN chmod +x ./setup-postfix.sh
ENTRYPOINT ["sh", "-c", "./setup-postfix.sh && ./server-entrypoint.sh"]