refresh dockerfile (it's smoller and faster now!)

This commit is contained in:
41666 2019-02-25 00:47:58 -06:00
parent e03f6810da
commit 47938dbb3a

View file

@ -1,18 +1,13 @@
FROM node:10 AS builder
# ENV NODE_ENV production
COPY ./UI /src/UI
RUN cd /src/UI && yarn && yarn build
COPY ./Server /src/Server
RUN cd /src/Server && yarn
RUN cp -r /src/UI/build /src/Server/public
WORKDIR /src
COPY . /src
# we double yarn here to strip off dev-only packages that are needed at build time.
RUN yarn --frozen-lockfile &&\
yarn build &&\
yarn --prod --frozen-lockfile
FROM mhart/alpine-node:10
ENV NODE_ENV production
WORKDIR /dist
EXPOSE 6769
RUN npm i -g pm2
COPY --from=builder /src/Server /dist
CMD pm2-docker index.js
COPY --from=builder /src /dist
CMD node index.js