Dockerfile 1.3 KB

1234567891011121314151617181920212223242526
  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 chmod 0777 / && mkdir -p /lms_resources && chmod 0777 /lms_resources && mkdir -p /ulearn && mkdir -p /ulearn/.uclms && mkdir -p /ulearn/.pm2 && chmod -R 0777 /ulearn && mkdir -p /.uclms && mkdir -p /.pm2 && chmod 0777 /.uclms && chmod 0777 /.pm2
  9. RUN groupadd --gid 2001 user2001 && groupadd ulearn && useradd -d /ulearn -u 2001 -g 2001 -G ulearn,user2001 user2001
  10. 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
  11. RUN npm i -g pm2@4.2.1
  12. WORKDIR /ulearn
  13. COPY current/ ./
  14. COPY entrypoint.sh .
  15. RUN yarn install
  16. RUN NODE_OPTIONS=--max_old_space_size=8192 npm run compile && chown -R root:ulearn build && chmod -R ga+w build
  17. ###########################################################################
  18. # run
  19. ###########################################################################
  20. EXPOSE 23000
  21. CMD ["/ulearn/entrypoint.sh"]