diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..0592f61 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.github/ +coverage/ +dist/ +node_modules/ + +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..132338a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM node:18-alpine AS base +WORKDIR /project +COPY . . +RUN npm ci + +FROM base AS test +CMD [ "npx", "jest", "--coverage" ] + +FROM base AS build +RUN npm run build + +FROM build AS prod +RUN npm ci --omit=dev +CMD ["npm", "run", "start"] \ No newline at end of file