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