Kaynağa Gözat

Merge remote-tracking branch 'origin/1.0.0_online' into 1.0.0_online

vian 6 yıl önce
ebeveyn
işleme
3bc314500c
4 değiştirilmiş dosya ile 38 ekleme ve 7 silme
  1. 10 1
      .babelrc
  2. 22 4
      Dockerfile
  3. 5 1
      package.json
  4. 1 1
      public/web/common_ajax.js

+ 10 - 1
.babelrc

@@ -1,3 +1,12 @@
 {
-  "presets": ["es2015", "stage-2"]
+  "presets": ["es2015", "stage-2"],
+  "plugins": [[
+    "transform-runtime",
+    {
+      "helpers": false,
+      "polyfill": false,
+      "regenerator": true,
+      "moduleName": "babel-runtime"
+    }
+  ]]
 }

+ 22 - 4
Dockerfile

@@ -2,22 +2,40 @@ FROM costbase:2.0 as build
 
 WORKDIR /home/ConstructionCost
 
-COPY package.json /home/ConstructionCost
+COPY package.json /home/ConstructionCost/
+COPY .babelrc /home/ConstructionCost/
 
 RUN cnpm install
 
-FROM base-alpine:latest
+FROM base-alpine:latest as babel
 
 COPY --from=build /home/ConstructionCost /home/ConstructionCost
 
+COPY config /home/ConstructionCost/src/config/
+COPY logs /home/ConstructionCost/src/logs/
+COPY modules /home/ConstructionCost/src/modules/
+COPY public /home/ConstructionCost/src/public/
+COPY importserver.js server.js socket.js  /home/ConstructionCost/src/
+
+WORKDIR /home/ConstructionCost
+
+RUN babel src -d dist
+
+FROM base-alpine:latest
+
 COPY . /home/ConstructionCost
 
 WORKDIR /home/ConstructionCost
 
+COPY --from=babel /home/ConstructionCost/dist /home/ConstructionCost
+COPY --from=babel /home/ConstructionCost/node_modules /home/ConstructionCost/node_modules/
+COPY public/web /home/ConstructionCost/public/web/
+
+
 RUN gulp build
 
 ENV NODE_ENV=prod
 
-ENTRYPOINT ["babel-node", "--max-old-space-size=2048"]
+ENTRYPOINT ["npm", "run"]
 
-CMD ["server.js"]
+CMD ["server"]

+ 5 - 1
package.json

@@ -5,6 +5,7 @@
   "devDependencies": {
     "body-parser": "^1.13.2",
     "babel-cli": "^6.24.1",
+    "babel-plugin-transform-runtime": "^6.23.0",
     "babel-preset-es2015": "^6.24.1",
     "babel-preset-stage-2": "^6.24.1",
     "express": "^4.13.1",
@@ -58,6 +59,9 @@
     "wiredep": "^2.2.2"
   },
   "scripts": {
-    "start": "C:\\Users\\mai\\AppData\\Roaming\\npm\\babel-node.cmd server.js"
+    "start": "C:\\Users\\mai\\AppData\\Roaming\\npm\\babel-node.cmd server.js",
+    "server":"node --max-old-space-size=2048 server.js",
+    "socket":"node socket.js",
+    "import":"node --max-old-space-size=2048 importserver.js"
   }
 }

+ 1 - 1
public/web/common_ajax.js

@@ -171,7 +171,7 @@ async function ajaxPost(url, data) {
             data: {'data': JSON.stringify(data)},
             dataType: 'json',
             cache: false,
-            timeout: 50000,
+            timeout: 200000,
             success: function(result){
                 if (!result.error || !result.err) {
                     resolve(result.data);