oneuptime/Haraka/Dockerfile.tpl

76 lines
2.0 KiB
Docker
Raw Normal View History

2024-10-16 14:54:57 +00:00
FROM public.ecr.aws/docker/library/node:21.7.3-alpine3.18
2024-02-16 07:40:22 +00:00
2022-12-30 09:18:22 +00:00
RUN mkdir /tmp/npm && chmod 2777 /tmp/npm && chown 1000:1000 /tmp/npm && npm config set cache /tmp/npm --global
RUN npm config set fetch-retries 5
RUN npm config set fetch-retry-mintimeout 100000
RUN npm config set fetch-retry-maxtimeout 600000
2023-09-21 16:09:09 +00:00
2023-08-25 10:16:31 +00:00
ARG GIT_SHA
ARG APP_VERSION
ENV GIT_SHA=${GIT_SHA}
ENV APP_VERSION=${APP_VERSION}
# IF APP_VERSION is not set, set it to 1.0.0
RUN if [ -z "$APP_VERSION" ]; then export APP_VERSION=1.0.0; fi
2023-08-15 14:11:36 +00:00
RUN apk add bash
2021-01-24 12:54:51 +00:00
# install dependence
RUN apk upgrade --update && \
apk add --no-cache -t .fetch-deps \
autoconf \
g++ \
2023-08-15 14:11:36 +00:00
bash \
curl \
2021-01-24 12:54:51 +00:00
gcc \
make \
2022-04-22 19:05:16 +00:00
python3 && \
2021-01-24 12:54:51 +00:00
addgroup -g 88 -S smtp && \
2023-08-15 14:11:36 +00:00
adduser -u 88 -D -S -G smtp -h /harakaapp smtp && \
2021-01-24 12:54:51 +00:00
# Install haraka and toobusy package
2023-08-15 14:11:36 +00:00
npm install -g --unsafe-perm Haraka toobusy-js && \
2021-01-24 12:54:51 +00:00
# # Cleaning up
apk del --purge -r .fetch-deps && \
apk add --no-cache tzdata openssl execline ca-certificates && \
rm -rf /var/cache/apk/* /tmp/* ~/.pearrc
2023-08-15 14:11:36 +00:00
RUN haraka -i /harakaapp
2023-08-15 20:09:00 +00:00
COPY ./Haraka/config/plugins /harakaapp/config/plugins
COPY ./Haraka/config/smtp.ini /harakaapp/config/smtp.ini
COPY ./Haraka/config/tls.ini /harakaapp/config/tls.ini
COPY ./Haraka/config/auth_flat_file.ini /harakaapp/config/auth_flat_file.ini
COPY ./Haraka/config/dkim_sign.ini /harakaapp/config/dkim_sign.ini
COPY ./Haraka/config/host_list /harakaapp/config/host_list
COPY ./Haraka/config/loglevel /harakaapp/config/loglevel
# create plugin directory
RUN mkdir -p /harakaapp/plugins
COPY ./Haraka/plugins/email_parser.js /harakaapp/plugins/email_parser.js
2021-01-24 12:54:51 +00:00
2023-08-15 20:09:00 +00:00
COPY ./Haraka/init.sh /init.sh
2023-08-15 14:11:36 +00:00
RUN chmod 755 /init.sh
2021-01-24 12:54:51 +00:00
# Copy package.json and package-lock.json
COPY ./Haraka/package.json /harakaapp/package.json
COPY ./Haraka/package-lock.json /harakaapp/package-lock.json
# Install dependencies
RUN cd /harakaapp && npm install
2022-11-08 15:24:58 +00:00
EXPOSE 2525
EXPOSE 110
EXPOSE 25
EXPOSE 587
EXPOSE 465
EXPOSE 143
EXPOSE 993
EXPOSE 995
2021-01-24 12:54:51 +00:00
2023-08-15 14:11:36 +00:00
CMD ["/init.sh"]