diff options
| -rw-r--r-- | .dockerignore | 6 | ||||
| -rw-r--r-- | Dockerfile | 27 |
2 files changed, 33 insertions, 0 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2061d6c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +/.nuxt +/.output +/node_modules + +.gitignore +README.md
\ No newline at end of file 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 |
