From f512bf1a4947e2632198dfb10094f48923889445 Mon Sep 17 00:00:00 2001 From: Thomas Osmonson Date: Mon, 30 Nov 2020 11:50:04 -0600 Subject: [PATCH] fix: dockerfile fixes --- Dockerfile | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index af1a14b8..bdc629d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,12 @@ -FROM node:12.14.1-alpine as base -WORKDIR /usr/src -COPY package.json yarn.lock /usr/src/ -RUN yarn install +FROM node:alpine COPY . . -RUN yarn build && \ - yarn --production - -FROM node:12.14.1-alpine -WORKDIR /usr/src -ENV NODE_ENV="production" -COPY --from=base /usr/src . +run apk --no-cache add --virtual native-deps \ + g++ gcc libgcc libstdc++ linux-headers make python && \ + npm install --quiet node-gyp -g &&\ + yarn && \ + apk del native-deps +ENV NODE_ENV production +RUN yarn build +RUN yarn cache clean EXPOSE 3000 -CMD ["node", "./server"] +CMD [ "yarn", "start" ]