FROM debian:jessie

MAINTAINER Robin Thoni <robin@rthoni.com>

RUN apt-get update &&\
    apt-get install -y opendkim opendkim-tools openssl libopendbx1-pgsql rsyslog &&\
    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN rm /etc/opendkim.conf &&\
    ln -s /etc/opendkim/opendkim.conf /etc/opendkim.conf

COPY ./run.sh /run.sh

COPY ./config /etc/opendkim/

RUN chown -R opendkim:opendkim /etc/opendkim

VOLUME ["/etc/opendkim/keys"]

CMD ["/run.sh"]
