diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..dc214f4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git/ +build/ +config/local.yaml +coverage/ +lib/ +node_modules/ +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8196eea --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM node:12-alpine +WORKDIR /app +RUN chown node:node /app +USER node +COPY . . +RUN npm install +RUN npm run build +RUN rm -rf node_modules + +FROM node:12-alpine +WORKDIR /app +RUN chown node:node /app +COPY --from=0 /app . +RUN npm install --production +USER root +RUN chown -R root:root . +USER node +EXPOSE 3000 +CMD ["node", "lib/index.js"]