Dockerfile 1.0 KB

123456789101112131415161718192021222324252627
  1. FROM phusion/passenger-nodejs:2.5.1
  2. ###########################################################################
  3. # install & build
  4. ###########################################################################
  5. RUN node -v
  6. RUN apt-get update -yqq && apt-get clean
  7. RUN npm i -g yarn@1.22 pm2@5.2
  8. RUN useradd -m ulearn
  9. RUN mkdir /home/ulearn/lms_resources && mkdir /home/ulearn/.uclms
  10. RUN chmod 0777 /home/ulearn/lms_resources
  11. RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl && chmod a+x kubectl && mv ./kubectl /usr/local/bin/kubectl
  12. RUN npm i -g pm2@4.2.1
  13. WORKDIR /home/ulearn
  14. COPY current/ ./
  15. COPY entrypoint.sh .
  16. RUN yarn install
  17. RUN NODE_OPTIONS=--max_old_space_size=8192 npm run compile && chown -R root:ulearn build && chmod -R ga+w build
  18. ###########################################################################
  19. # run
  20. ###########################################################################
  21. EXPOSE 23000
  22. CMD ["/home/ulearn/entrypoint.sh"]