Use entrypoint to sed some vars

master
andryyy 2016-12-15 10:07:09 +01:00
parent 2ab9a2d7b5
commit 9ce260fbe0
2 changed files with 9 additions and 1 deletions

View File

@ -27,7 +27,8 @@ RUN wget http://hg.dovecot.org/dovecot-antispam-plugin/archive/tip.tar.gz -O - |
&& make \ && make \
&& make install && make install
ADD rspamd-pipe /usr/local/bin/rspamd-pipe COPY ./rspamd-pipe /usr/local/bin/rspamd-pipe
COPY ./docker-entrypoint.sh /
RUN chmod +x /usr/local/bin/rspamd-pipe RUN chmod +x /usr/local/bin/rspamd-pipe
RUN groupadd -g 5000 vmail RUN groupadd -g 5000 vmail
@ -35,4 +36,5 @@ RUN useradd -g vmail -u 5000 vmail -d /var/vmail
EXPOSE 24 10001 EXPOSE 24 10001
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/usr/sbin/dovecot", "-F"] CMD ["/usr/sbin/dovecot", "-F"]

View File

@ -0,0 +1,6 @@
#!/bin/bash
set -e
sed -i "/^connect/c\connect = \"host=mysql dbname=${DBNAME} user=${DBUSER} password=${DBPASS}\"" /etc/dovecot/sql/*
exec "$@"