Przeglądaj źródła

Обновить 'docker/Dockerfile'

Vladislav Medov 2 lat temu
rodzic
commit
0e33e5ccac
1 zmienionych plików z 30 dodań i 14 usunięć
  1. 30 14
      docker/Dockerfile

+ 30 - 14
docker/Dockerfile

@@ -1,22 +1,38 @@
-FROM registry.unicraft.org/node:8-update
+FROM phusion/passenger-nodejs:2.5.1
 
-RUN mkdir -p /ulearn && mkdir -p /lms_resources && mkdir -p /ulearn/.uclms && mkdir -p /ulearn/.pm2 && chmod 0777 / && chmod -R 0777 /ulearn
-RUN for i in `nawk 'BEGIN{ for(i=2000;i<=2200;i++) print i}'`; do groupadd --gid $i user$i; useradd -d /ulearn -u $i -g $i user$i; usermod -G ulearn,user$i user$i; done
-RUN apt-get update
-RUN apt-get -y install chinese*
-#RUN yarn global add pm2
-RUN npm install -g pm2@4.2.1
+###########################################################################
+# install & build
+###########################################################################
+
+RUN node -v
+RUN apt-get update -yqq && apt-get clean
+RUN npm i -g yarn@1.22 pm2@5.2
+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
+RUN groupadd --gid 2001 user2001
+	&& groupadd ulearn
+	&& useradd -d /ulearn -u 2001 -g 2001 -G ulearn,user2001 user2001
+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
+RUN npm i -g pm2@4.2.1
 WORKDIR /ulearn
 COPY current/ ./
 COPY entrypoint.sh .
+RUN yarn install
+RUN NODE_OPTIONS=--max_old_space_size=8192 npm run compile && chown -R root:ulearn build && chmod -R ga+w build
 
-RUN yarn install --ignore-engines 
-#RUN yarn upgrade @ckeditor/ckeditor5-build-classic --ignore-engines
-RUN npm run compile && chown -R root:ulearn build && chmod -R ga+w build
-
-#RUN find . -not -name '.' -not -name '..' -not -name 'entrypoint.sh' -not -name 'build.server.js' -not -name 'ecosystem.json' -not -path './build*' -not -path './node_modules*' -not -path './resources*'  -not -path './i18n*' -exec rm -Rf {} +
+###########################################################################
+# run
+###########################################################################
 
 EXPOSE 23000
-# ENV HOME=/ulearn
 
-CMD ["/ulearn/entrypoint.sh"]
+CMD ["/ulearn/entrypoint.sh"]