system-config/docker/mailman/core/Dockerfile
Clark Boylan 12d4355385 Fork the maxking/docker-mailman images
These images have a number of issues we've identified and worked
around. The current iteration of this change is essentially
identical to upstream but with a minor tweak to allow the latest
mailman version, and adjusts the paths for hyperkitty and postorius
URLs to match those in the upstream mailman-web codebase, but
doesn't try to address the other items. However, we should consider
moving our fixes from ansible into the docker images where possible
and upstream those updates.

Unfortunately upstream hasn't been super responsive so far hence this
fork. For tracking purposes here are the issues/PRs we've already filed
upstream:

  https://github.com/maxking/docker-mailman/pull/552
  https://github.com/maxking/docker-mailman/issues/548
  https://github.com/maxking/docker-mailman/issues/549
  https://github.com/maxking/docker-mailman/issues/550

Change-Id: I3314037d46c2ef2086a06dea0321d9f8cdd35c73
2022-11-21 16:51:02 +00:00

38 lines
1.3 KiB
Docker

# syntax = docker/dockerfile:1.3
# Use 3.15 for Core since it has Python 3.9
FROM alpine:3.15
#Add startup script to container
COPY docker-entrypoint.sh /usr/local/bin/
# Add requirements file.
COPY requirements.txt /tmp/
#Install all required packages, add user for executing mailman and set execution rights for startup script
RUN --mount=type=cache,target=/root/.cache \
apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev postgresql-dev \
libffi-dev \
# Mailman html to plaintext conversion uses lynx.
# psutil needs linux-headers to compile on musl c library.
&& apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers py-cryptography mariadb-connector-c lynx \
&& python3 -m pip install -U pip setuptools wheel \
&& python3 -m pip install psycopg2 \
gunicorn==19.9.0 \
pymysql \
sqlalchemy \
-r /tmp/requirements.txt \
&& apk del build-deps \
&& adduser -S mailman
# Change the working directory.
WORKDIR /opt/mailman
#Expose the ports for the api (8001) and lmtp (8024)
EXPOSE 8001 8024
ENV MAILMAN_CONFIG_FILE /etc/mailman.cfg
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["master", "--force"]