From 1d2fd8e82f4d2ccfa4cf9e434a05e43250162449 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Wed, 13 Mar 2024 00:28:46 +0000 Subject: Add dockerfile --- Dockerfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Dockerfile (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bf50ea0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM node:20-slim as base + +ENV NODE_ENV=production + +WORKDIR /src + + +FROM base as build + +COPY package.json package-lock.json ./ +RUN npm install + +COPY . ./ + +RUN npm run build +RUN npm prune + + +FROM base + +ENV PORT=3000 + +COPY --from=build /src/.output /src/.output +# Optional, only needed if you rely on unbundled dependencies +# COPY --from=build /src/node_modules /src/node_modules + +CMD [ "node", ".output/server/index.mjs" ] \ No newline at end of file -- cgit v1.2.3-70-g09d2