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.

82 lines
2.1KB

  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. jq \
  24. nginx \
  25. && apk add -U wireguard-tools
  26. # Installing Python dependencies for additional
  27. # functionnalities
  28. RUN apk add --no-cache --virtual .pythonmakedepends \
  29. build-base \
  30. python3-dev \
  31. py3-pip \
  32. && pip3 install --no-cache-dir \
  33. actdiag \
  34. pip install supervisor supervisor-stdout \
  35. 'blockdiag[pdf]' \
  36. nwdiag \
  37. seqdiag \
  38. && apk del -r --no-cache .pythonmakedepends
  39. COPY dist /home/node/swarmlab-app
  40. COPY src-local/ecosystem.config.js /home/node/swarmlab-app/ecosystem.config.js
  41. #COPY src-local/llo /home/node/swarmlab-app/llo
  42. #COPY src-local/package.json /home/node/swarmlab-app/package.json
  43. #COPY src-local/hybrid /home/node/swarmlab-app/hybrid
  44. #COPY src-local/instance /home/node/swarmlab-app/instance
  45. #COPY src-local/logs /home/node/swarmlab-app/logs
  46. #COPY src-local/myconfig /home/node/swarmlab-app/myconfig
  47. #COPY src-local/start-server.sh /home/node/swarmlab-app/start-server.sh
  48. #COPY src-local/stop-server.sh /home/node/swarmlab-app/stop-server.sh
  49. RUN mkdir -p /home/node/run \
  50. && mkdir -p /home/node/logs \
  51. && chown -R node.node /home/node \
  52. && chmod -R 755 /home/node \
  53. && ln -s /usr/local/bin/node /usr/bin/node \
  54. && mkdir -p /run/nginx \
  55. && npm install pm2@latest -g
  56. USER node
  57. #WORKDIR /home/node/swarmlab-app
  58. #RUN set -uex; \
  59. # # npm run build no need it!
  60. # npm install; \
  61. # npm i async chokidar url-exist-sync axios socketio-auth socket.io-client https socket.io bufferutil utf-8-validate simple-git --save \
  62. # npm audit fix; \
  63. # npm cache clean --force;
  64. #
  65. WORKDIR /home/node/swarmlab-app
  66. VOLUME /home/node/swarmlab-app
  67. EXPOSE 80 443 8080 3000 3080
  68. CMD ["pm2-runtime", "/home/node/swarmlab-app/ecosystem.config.js"]