try replacing config tags with environment variables
All checks were successful
Build OCI Containers / Build Containers (push) Successful in 1m7s

This commit is contained in:
Stefan Harmuth 2024-03-09 16:37:02 +01:00
parent b752ac0d1f
commit 7e54796d6e
2 changed files with 15 additions and 2 deletions

View File

@ -1,13 +1,16 @@
FROM debian:bookworm-slim FROM debian:bookworm-slim
COPY entrypoint.sh /entrypoint.sh
RUN apt-get update && \ RUN apt-get update && \
apt-get -y upgrade && \ apt-get -y upgrade && \
apt-get -y --purge autoremove && \ apt-get -y --purge autoremove && \
apt-get -y install postfix postfix-pgsql postgrey && \ apt-get -y install postfix postfix-pgsql postgrey && \
apt-get -y clean apt-get -y clean && \
chmod a+x /entrypoint.sh
EXPOSE 25/tcp EXPOSE 25/tcp
EXPOSE 465/tcp EXPOSE 465/tcp
EXPOSE 587/tcp EXPOSE 587/tcp
CMD ["/usr/sbin/postfix", "start-fg"] CMD ["/entrypoint.sh"]

10
postfix/entrypoint.sh Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
for cf in /etc/postfix/*.cf; do
sed -iE -e 's/%DB_PASSWORD%/${DB_PASSWORD}/g' \
-e 's/%DB_HOST%/${DB_HOST}/g' \
-e 's/%DB_USER%/${DB_USER}/g' \
-e 's/%DB_DATABASE%/${DB_DATABASE}/g' ${cf};
done
/usr/sbin/postfix start-fg