forked from cisagov/cyhy-mailer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (27 loc) · 990 Bytes
/
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
FROM python:alpine
MAINTAINER Shane Frasier <[email protected]>
# Install shadow so we have adduser and addgroup. This is a build
# dependency that will be removed at the end.
#
# I also reinstall wget with openssl, since otherwise wget does not
# seem to know how to HTTPS.
RUN apk --no-cache add openssl shadow wget
# Update pip, setuptools, and wheel
RUN pip3 install --upgrade pip setuptools wheel
# Install cyhy-mailer
RUN mkdir cyhy-mailer
RUN wget -q -O - https://github.com/cisagov/cyhy-mailer/tarball/develop | tar xz --strip-components=1 -C cyhy-mailer
RUN pip3 install --upgrade ./cyhy-mailer
# Create unprivileged user
ENV MAILER_HOME=/home/mailer
RUN mkdir ${MAILER_HOME} \
&& addgroup -S mailer \
&& adduser -S -g "Mailer user" -G mailer mailer \
&& chown -R mailer:mailer ${MAILER_HOME}
# Remove build dependencies
RUN apk --no-cache del shadow
# Prepare to Run
WORKDIR ${MAILER_HOME}
USER mailer:mailer
ENTRYPOINT ["cyhy-mailer"]
CMD ["--help"]