Files
OSIT-Mailman3/postorius/Dockerfile
Antonio Rocco 1d883a7614 [web, postorius] Fix libldap installation package group
The libldap package is not installed in the mailman-web:0.5 and
postorius images despite being listed as a dependency in the Dockerfile.
This issue arises because libldap is included in the .build-deps virtual
package group, which is removed at the end of the build process, causing
the package to be uninstalled.

This commit addresses the issue by moving libldap from the .build-deps
virtual package group to the .mailman-rundeps virtual package group in
both the web and postorius Dockerfiles. This ensures that libldap
remains installed in the final image, as it is now part of the runtime
dependencies.

Changes:
- Move libldap installation from .build-deps to .mailman-rundeps in
  postorius/Dockerfile and postorius/Dockerfile.env;
- Move libldap installation from .build-deps to .mailman-rundeps in
  web/Dockerfile and web/Dockerfile.env.

These changes are necessary to ensure that the libldap package is
available in the running containers, preventing runtime errors related
to missing LDAP dependencies.

Signed-off-by: Antonio Rocco <8lue@8lue.xyz>
2024-06-17 16:00:01 +02:00

47 lines
1.6 KiB
Docker

# syntax = docker/dockerfile:1.3
FROM alpine:3.20.0
# Install packages and dependencies for postorius and hyperkitty Add user for
# executing apps, change ownership for uwsgi+django files and set execution
# rights for management script
RUN --mount=type=cache,target=/root/.cache \
set -ex \
&& apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers \
postgresql-dev mariadb-dev mariadb-connector-c python3-dev libffi-dev openldap-dev cargo rust \
&& apk add --no-cache --virtual .mailman-rundeps bash sassc tzdata libldap \
postgresql-client mysql-client py3-mysqlclient curl mailcap gettext \
python3 py3-pip libffi libuuid pcre-dev py-cryptography \
&& python3 -m pip install --break-system-packages -U 'Django<4.3' pip setuptools wheel \
&& python3 -m pip install --break-system-packages postorius==1.3.10 \
uwsgi \
psycopg2 \
dj-database-url \
mysqlclient \
typing \
django-auth-ldap \
python-memcached \
tzdata \
&& apk del .build-deps \
&& addgroup -S mailman \
&& adduser -S -G mailman mailman
# Add needed files for uwsgi server + settings for django
COPY mailman-web /opt/mailman-web
# Add startup script to container
COPY docker-entrypoint.sh /usr/local/bin/
RUN chown -R mailman /opt/mailman-web/ \
&& chmod u+x /opt/mailman-web/manage.py
WORKDIR /opt/mailman-web
# Expose port 8000 for http and port 8080 for uwsgi
# (see web/mailman-web/uwsgi.ini#L2-L4)
EXPOSE 8000 8080
# Use stop signal for uwsgi server
STOPSIGNAL SIGINT
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["uwsgi", "--ini", "/opt/mailman-web/uwsgi.ini"]