diff --git a/.dockerignore b/.dockerignore index 1837405..5ba06f9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,22 @@ **/node_modules **/.next -**/dist \ No newline at end of file +**/dist + +.vscode +.git +.gitattributes + +.editorconfig + +.eslintignore +.eslintrc.cjs + +.npmrc + +.prettierrc +.pretieriignore + +README.md + +Dockerfile + diff --git a/.gitignore b/.gitignore index dedc27a..dae931e 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ node_modules dist dist-ssr *.local +pnpm-lock.yaml # Editor directories and files !.vscode/extensions.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..22783c6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +FROM node:18-alpine AS builder + +WORKDIR /app +COPY package.json pnpm-lock.yaml ./ + +RUN npm install -g pnpm && \ + echo "Installing pnpm..." +RUN pnpm install --frozen-lockfile && \ + echo "Installing deps..." + +COPY . . + +RUN pnpm run build && \ + echo "Building..." && \ + pnpm prune --production + + +FROM node:18-alpine + +WORKDIR /app + +COPY --from=builder /app/build build/ +COPY --from=builder /app/node_modules node_modules/ +COPY package.json . + +EXPOSE 3000 + +ENV NODE_ENV=production +CMD [ "node", "build" ] \ No newline at end of file