forked from turt2live/matrix-dimension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (31 loc) · 1.47 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM node:14.17.5-alpine AS builder
LABEL maintainer="Andreas Peters <support@aventer.biz>"
#Upstream URL: https://git.aventer.biz/AVENTER/docker-matrix-dimension
WORKDIR /home/node/matrix-dimension
RUN mkdir -p /home/node/matrix-dimension
RUN apk --no-cache add python2 glib-dev make g++ vips-dev libc-dev
COPY . /home/node/matrix-dimension
RUN chown -R node /home/node/matrix-dimension
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
COPY --from=builder /home/node/matrix-dimension/docker-entrypoint.sh /
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
RUN chown -R node /home/node/matrix-dimension
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/
USER node
RUN npm clean-install --production
VOLUME ["/data"]
# Ensure the database doesn't get lost to the container
ENV DIMENSION_DB_PATH=/data/dimension.db
EXPOSE 8184
# CMD ["/bin/sh"]
ENTRYPOINT ["/docker-entrypoint.sh"]