diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2024-03-13 00:28:46 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2024-03-13 00:28:46 +0000 |
| commit | 1d2fd8e82f4d2ccfa4cf9e434a05e43250162449 (patch) | |
| tree | 6e068882ce0ee24585787239205013af086c3698 /Dockerfile | |
| parent | 543aa0cd4a461285298d33a90ab3f11a9f084ca5 (diff) | |
Add dockerfile
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 27 |
1 files changed, 27 insertions, 0 deletions
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 |
