|
@@ -2,22 +2,38 @@ FROM costbase:2.0 as build
|
|
|
|
|
|
|
|
WORKDIR /home/ConstructionCost
|
|
WORKDIR /home/ConstructionCost
|
|
|
|
|
|
|
|
-COPY package.json /home/ConstructionCost
|
|
|
|
|
|
|
+COPY package.json /home/ConstructionCost/
|
|
|
|
|
+COPY .babelrc /home/ConstructionCost/
|
|
|
|
|
|
|
|
RUN cnpm install
|
|
RUN cnpm install
|
|
|
|
|
|
|
|
-FROM base-alpine:latest
|
|
|
|
|
|
|
+FROM base-alpine:latest as babel
|
|
|
|
|
|
|
|
COPY --from=build /home/ConstructionCost /home/ConstructionCost
|
|
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
|
|
COPY . /home/ConstructionCost
|
|
|
|
|
|
|
|
WORKDIR /home/ConstructionCost
|
|
WORKDIR /home/ConstructionCost
|
|
|
|
|
|
|
|
|
|
+COPY --from=babel /home/ConstructionCost/dist /home/ConstructionCost
|
|
|
|
|
+COPY --from=babel /home/ConstructionCost/node_modules /home/ConstructionCost/node_modules/
|
|
|
|
|
+
|
|
|
RUN gulp build
|
|
RUN gulp build
|
|
|
|
|
|
|
|
ENV NODE_ENV=prod
|
|
ENV NODE_ENV=prod
|
|
|
|
|
|
|
|
-ENTRYPOINT ["babel-node", "--max-old-space-size=2048"]
|
|
|
|
|
|
|
+ENTRYPOINT ["npm", "run"]
|
|
|
|
|
|
|
|
-CMD ["server.js"]
|
|
|
|
|
|
|
+CMD ["server"]
|