mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 01:05:53 -04:00
commit
66bbda6b8e
41
Dockerfile
Normal file
41
Dockerfile
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
FROM node:9.11.2-alpine
|
||||||
|
|
||||||
|
LABEL maintainer="Andreas Peters <support@aventer.biz>"
|
||||||
|
#Upstream URL: https://git.aventer.biz/AVENTER/docker-matrix-dimension
|
||||||
|
|
||||||
|
RUN apk update && \
|
||||||
|
apk add 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 && \
|
||||||
|
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
|
||||||
|
|
||||||
|
USER node
|
||||||
|
|
||||||
|
VOLUME ["/data"]
|
||||||
|
|
||||||
|
EXPOSE 8184
|
||||||
|
#CMD ["/bin/sh"]
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
|
|
12
docker-entrypoint.sh
Executable file
12
docker-entrypoint.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd /home/node/matrix-dimension/
|
||||||
|
|
||||||
|
if [ -f "/data/config.yaml" ]; then
|
||||||
|
cp /data/config.yaml /home/node/matrix-dimension/config/production.yaml
|
||||||
|
NODE_ENV=production node build/app/index.js
|
||||||
|
else
|
||||||
|
cp /home/node/matrix-dimension/config/default.yaml /data/config.yaml
|
||||||
|
echo "A default config file has been placed in the /data/ volume please review and make any required changes and start the container again"
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user