forked from maildev/maildev
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
36 lines (28 loc) · 826 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Base
FROM node:18-alpine AS base
ENV NODE_ENV=production
ENV MAILDEV_WEB_PORT=1080
ENV MAILDEV_SMTP_PORT=1025
ENV MAILDEV_MAIL_DIRECTORY=/tmp/maildev
# Build
FROM base AS build
WORKDIR /root
COPY . .
RUN npm install typescript -g \
&& npm install sass -g \
&& npm install \
&& npm prune \
&& npm cache clean --force \
&& npm run build
# Prod
FROM base AS prod
RUN mkdir -p /tmp/maildev && chown node:node /tmp/maildev
USER node
WORKDIR /home/node
COPY --chown=node:node . .
COPY --chown=node:node --from=build /root/node_modules ./node_modules
COPY --chown=node:node --from=build /root/dist ./dist
EXPOSE $MAILDEV_WEB_PORT $MAILDEV_SMTP_PORT
ENTRYPOINT ["bin/maildev"]
HEALTHCHECK --interval=10s --timeout=1s \
CMD wget -O - http://localhost:${MAILDEV_WEB_PORT}${MAILDEV_BASE_PATHNAME}/healthz || exit 1