2021-08-30 17:52:19 -04:00
|
|
|
FROM node:14.17.5-alpine AS builder
|
2018-07-19 14:57:07 -04:00
|
|
|
|
2018-07-19 19:20:43 -04:00
|
|
|
LABEL maintainer="Andreas Peters <support@aventer.biz>"
|
|
|
|
#Upstream URL: https://git.aventer.biz/AVENTER/docker-matrix-dimension
|
|
|
|
|
2020-03-20 16:22:41 -04:00
|
|
|
WORKDIR /home/node/matrix-dimension
|
2018-09-16 04:25:05 -04:00
|
|
|
|
2020-03-20 16:22:41 -04:00
|
|
|
RUN mkdir -p /home/node/matrix-dimension
|
2018-07-19 14:57:07 -04:00
|
|
|
|
|
|
|
COPY . /home/node/matrix-dimension
|
|
|
|
|
2020-03-20 16:22:41 -04:00
|
|
|
RUN chown -R node /home/node/matrix-dimension
|
2018-07-19 14:57:07 -04:00
|
|
|
|
|
|
|
USER node
|
|
|
|
|
2020-03-20 16:22:41 -04:00
|
|
|
RUN npm clean-install && \
|
|
|
|
node /home/node/matrix-dimension/scripts/convert-newlines.js /home/node/matrix-dimension/docker-entrypoint.sh && \
|
|
|
|
NODE_ENV=production npm run-script build
|
|
|
|
|
2021-08-30 17:52:19 -04:00
|
|
|
FROM node:14.17.5-alpine
|
2020-03-20 16:22:41 -04:00
|
|
|
|
|
|
|
WORKDIR /home/node/matrix-dimension
|
2018-07-19 14:57:07 -04:00
|
|
|
|
2020-03-20 16:22:41 -04:00
|
|
|
COPY --from=builder /home/node/matrix-dimension/docker-entrypoint.sh /
|
2018-07-19 14:57:07 -04:00
|
|
|
|
2020-03-20 16:22:41 -04:00
|
|
|
COPY --from=builder /home/node/matrix-dimension/build /home/node/matrix-dimension/build
|
|
|
|
COPY --from=builder /home/node/matrix-dimension/package* /home/node/matrix-dimension/
|
|
|
|
COPY --from=builder /home/node/matrix-dimension/config /home/node/matrix-dimension/config
|
2018-07-19 14:57:07 -04:00
|
|
|
|
2020-03-20 16:22:41 -04:00
|
|
|
RUN chown -R node /home/node/matrix-dimension
|
2018-07-19 14:57:07 -04:00
|
|
|
|
2020-12-29 03:38:22 -05:00
|
|
|
RUN mkdir /data && chown -R node /data
|
|
|
|
|
2018-07-19 14:57:07 -04:00
|
|
|
USER node
|
|
|
|
|
2020-03-20 16:22:41 -04:00
|
|
|
RUN npm clean-install --production
|
|
|
|
|
2018-07-19 14:57:07 -04:00
|
|
|
VOLUME ["/data"]
|
|
|
|
|
2018-07-21 11:20:47 -04:00
|
|
|
# Ensure the database doesn't get lost to the container
|
|
|
|
ENV DIMENSION_DB_PATH=/data/dimension.db
|
|
|
|
|
2018-07-19 14:57:07 -04:00
|
|
|
EXPOSE 8184
|
2020-03-20 16:22:41 -04:00
|
|
|
# CMD ["/bin/sh"]
|
2018-07-19 14:57:07 -04:00
|
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
2020-03-20 16:22:41 -04:00
|
|
|
|