diff --git a/Dockerfile b/Dockerfile index 38ec879..a677dd1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ No newline at end of file +COPY --from=builder /src /dist +CMD node index.js