matrix-dimension/Dockerfile

47 lines
1.2 KiB
Docker
Raw Normal View History

FROM node:12.16.1-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
WORKDIR /home/node/matrix-dimension
2018-09-16 04:25:05 -04:00
RUN mkdir -p /home/node/matrix-dimension
2018-07-19 14:57:07 -04:00
COPY . /home/node/matrix-dimension
RUN chown -R node /home/node/matrix-dimension
2018-07-19 14:57:07 -04:00
USER node
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
FROM node:12.16.1-alpine
WORKDIR /home/node/matrix-dimension
2018-07-19 14:57:07 -04:00
COPY --from=builder /home/node/matrix-dimension/docker-entrypoint.sh /
2018-07-19 14:57:07 -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
RUN chown -R node /home/node/matrix-dimension
2018-07-19 14:57:07 -04:00
RUN mkdir /data && chown -R node /data
2018-07-19 14:57:07 -04:00
USER node
RUN npm clean-install --production
2018-07-19 14:57:07 -04:00
VOLUME ["/data"]
# 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
# CMD ["/bin/sh"]
2018-07-19 14:57:07 -04:00
ENTRYPOINT ["/docker-entrypoint.sh"]