You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.6 KiB
70 lines
1.6 KiB
#FROM alpine:3.11
|
|
FROM node:alpine
|
|
|
|
LABEL MAINTAINERS="Guillaume Scheibel <guillaume.scheibel@gmail.com>, Damien DUPORTAL <damien.duportal@gmail.com>"
|
|
|
|
# Installing package required for the runtime
|
|
RUN apk add --no-cache \
|
|
bash \
|
|
curl \
|
|
ca-certificates \
|
|
findutils \
|
|
font-bakoma-ttf \
|
|
git \
|
|
graphviz \
|
|
inotify-tools \
|
|
make \
|
|
python3 \
|
|
py3-pillow \
|
|
py3-setuptools \
|
|
tzdata \
|
|
unzip \
|
|
build-base \
|
|
libxml2-dev \
|
|
which \
|
|
nginx
|
|
|
|
# Installing Python dependencies for additional
|
|
# functionnalities
|
|
RUN apk add --no-cache --virtual .pythonmakedepends \
|
|
build-base \
|
|
python3-dev \
|
|
py3-pip \
|
|
&& pip3 install --no-cache-dir \
|
|
actdiag \
|
|
pip install supervisor supervisor-stdout \
|
|
'blockdiag[pdf]' \
|
|
nwdiag \
|
|
seqdiag \
|
|
&& apk del -r --no-cache .pythonmakedepends
|
|
|
|
|
|
COPY dist /home/node/swarmlab-app
|
|
COPY src-local/llo /home/node/server/llo
|
|
COPY src-local/package.json /home/node/server/package.json
|
|
|
|
RUN mkdir -p /home/node/run \
|
|
&& mkdir -p /home/node/logs \
|
|
&& chown -R node.node /home/node \
|
|
&& chmod -R 755 /home/node \
|
|
&& ln -s /usr/local/bin/node /usr/bin/node \
|
|
&& mkdir -p /run/nginx \
|
|
&& npm install pm2@latest -g
|
|
|
|
|
|
USER node
|
|
|
|
WORKDIR /home/node/server
|
|
RUN set -uex; \
|
|
# npm run build no need it!
|
|
npm install; \
|
|
npm i async chokidar url-exist-sync axios socketio-auth socket.io-client https socket.io bufferutil utf-8-validate --save \
|
|
npm audit fix; \
|
|
npm cache clean --force;
|
|
|
|
WORKDIR /home/node/swarmlab-app
|
|
VOLUME /home/node/swarmlab-app
|
|
|
|
EXPOSE 443 8080 3000 3080
|
|
|
|
CMD ["pm2-runtime", "ecosystem.config.js"]
|
|
|