move package files to improve docker performance

This commit is contained in:
Karol Wypchlo 2020-07-30 13:08:57 +02:00
parent 0ae464dc60
commit 714c183797
8 changed files with 9 additions and 11 deletions

View File

@ -2,19 +2,16 @@ FROM node:14.6.0
WORKDIR /usr/app WORKDIR /usr/app
RUN yarn init -y && \ RUN yarn init -y
yarn add express express-http-proxy hs-client RUN yarn add express express-http-proxy hs-client
COPY handshake-api/index.js ./ COPY *.js ./
ENV HOST="localhost"
ENV PORT=3100
ENV HSD_NETWORK="main" ENV HSD_NETWORK="main"
ENV HSD_HOST="0.0.0.0" ENV HSD_HOST="0.0.0.0"
ENV HSD_PORT=12037 ENV HSD_PORT=12037
ENV HSD_API_KEY="foo" ENV HSD_API_KEY="foo"
EXPOSE $PORT EXPOSE 3100
ENV NODE_ENV production
ENTRYPOINT ["node", "index.js"] CMD [ "node", "index.js" ]

View File

@ -5,7 +5,8 @@ WORKDIR /usr/app
RUN yarn init -y RUN yarn init -y
RUN yarn add express body-parser lowdb node-schedule superagent lodash http-status-codes RUN yarn add express body-parser lowdb node-schedule superagent lodash http-status-codes
EXPOSE 3100 COPY *.js ./
EXPOSE 3100
ENV NODE_ENV production ENV NODE_ENV production
CMD [ "node", "health-check/index.js" ] CMD [ "node", "index.js" ]