FROM node:8-slim ARG DOMAIN RUN apt update && apt -y install git python make RUN git clone https://github.com/nodemailer/wildduck-webmail /webmail WORKDIR /webmail RUN git checkout 5c54625a8b192823184ba7f5da41f3414e76db94 COPY ./config /webmail/config COPY ./views /webmail/views RUN chown node.node -R /webmail USER node RUN npm install RUN npm run bowerdeps RUN find ./config ./views -type f -exec sed -i "s/{{DOMAIN}}/$DOMAIN/g" {} +