matrix-dimension/Dockerfile

55 lines
1.5 KiB
Docker
Raw Permalink Normal View History

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
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
RUN apk --no-cache add python2 glib-dev make g++ vips-dev libc-dev
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
ENV CPATH=/usr/include/glib-2.0:/usr/lib/glib-2.0/include/
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:14.17.5-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
RUN apk --no-cache add python2 glib-dev make g++ vips-dev libc-dev
ENV CPATH=/usr/include/glib-2.0:/usr/lib/glib-2.0/include/
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"]