diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5c58615 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +node_modules +.output +.nuxt +.git +.gitignore +Dockerfile* +*.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c55688d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +# syntax=docker/dockerfile:1 + +FROM node:22-alpine AS base +ENV PNPM_HOME=/pnpm +ENV PATH=$PNPM_HOME:$PATH +RUN corepack enable + +FROM base AS build +WORKDIR /app + +COPY package.json pnpm-lock.yaml ./ +RUN pnpm install --frozen-lockfile + +COPY . . +RUN pnpm build + +FROM node:22-alpine AS runner +WORKDIR /app + +ENV NODE_ENV=production +ENV HOST=0.0.0.0 +ENV PORT=3000 + +COPY --from=build /app/.output ./.output + +EXPOSE 3000 +CMD ["node", ".output/server/index.mjs"]