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.

71 lines
1.6KB

  1. #FROM alpine:3.11
  2. FROM node:alpine
  3. LABEL MAINTAINERS="Guillaume Scheibel <guillaume.scheibel@gmail.com>, Damien DUPORTAL <damien.duportal@gmail.com>"
  4. # Installing package required for the runtime
  5. RUN apk add --no-cache \
  6. bash \
  7. curl \
  8. ca-certificates \
  9. findutils \
  10. font-bakoma-ttf \
  11. git \
  12. graphviz \
  13. inotify-tools \
  14. make \
  15. python3 \
  16. py3-pillow \
  17. py3-setuptools \
  18. tzdata \
  19. unzip \
  20. build-base \
  21. libxml2-dev \
  22. which \
  23. nginx
  24. # Installing Python dependencies for additional
  25. # functionnalities
  26. RUN apk add --no-cache --virtual .pythonmakedepends \
  27. build-base \
  28. python3-dev \
  29. py3-pip \
  30. && pip3 install --no-cache-dir \
  31. actdiag \
  32. pip install supervisor supervisor-stdout \
  33. 'blockdiag[pdf]' \
  34. nwdiag \
  35. seqdiag \
  36. && apk del -r --no-cache .pythonmakedepends
  37. COPY dist /home/node/swarmlab-app
  38. COPY src-local/llo /home/node/server/llo
  39. COPY src-local/package.json /home/node/server/package.json
  40. RUN mkdir -p /home/node/run \
  41. && mkdir -p /home/node/logs \
  42. && chown -R node.node /home/node \
  43. && chmod -R 755 /home/node \
  44. && ln -s /usr/local/bin/node /usr/bin/node \
  45. && mkdir -p /run/nginx \
  46. && npm install pm2@latest -g
  47. USER node
  48. WORKDIR /home/node/server
  49. RUN set -uex; \
  50. # npm run build no need it!
  51. npm install; \
  52. npm i async chokidar url-exist-sync axios socketio-auth socket.io-client https socket.io bufferutil utf-8-validate --save \
  53. npm audit fix; \
  54. npm cache clean --force;
  55. WORKDIR /home/node/swarmlab-app
  56. VOLUME /home/node/swarmlab-app
  57. EXPOSE 443 8080 3000 3080
  58. CMD ["pm2-runtime", "ecosystem.config.js"]