forked from turt2live/matrix-dimension
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
47 lines (31 loc) · 1.28 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
FROM node:10.16.0-alpine
LABEL maintainer="Andreas Peters <[email protected]>"
#Upstream URL: https://git.aventer.biz/AVENTER/docker-matrix-dimension
RUN apk add dos2unix --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community/ --allow-untrusted
RUN apk update && \
apk add --no-cache bash gcc python make g++ sqlite && \
mkdir /home/node/.npm-global && \
mkdir -p /home/node/app
COPY ./docker-entrypoint.sh /
COPY . /home/node/matrix-dimension
RUN chown -R node:node /home/node/app && \
chown -R node:node /home/node/.npm-global && \
chown -R node:node /home/node/matrix-dimension
USER node
ENV PATH=/home/node/.npm-global/bin:$PATH
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
RUN cd /home/node/matrix-dimension && \
npm install -D wd rimraf webpack webpack-command sqlite3 pg pg-hstore && \
NODE_ENV=production npm run-script build:web && npm run-script build:app
USER root
RUN apk del gcc make g++ && \
rm /home/node/matrix-dimension/Dockerfile && \
rm /home/node/matrix-dimension/docker-entrypoint.sh && \
dos2unix /docker-entrypoint.sh
USER node
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"]