diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4e402bf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,37 @@ +# ---- Build stage ---- +FROM node:22-alpine AS builder + +WORKDIR /app + +# Install pnpm +RUN corepack enable && corepack prepare pnpm@latest --activate + +# Copy dependency manifests +COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ +COPY .npmrc ./ + +# Install dependencies +RUN pnpm install --frozen-lockfile + +# Copy source +COPY . . + +# Build the app +RUN pnpm run build + +# ---- Production stage ---- +FROM node:22-alpine AS runner + +WORKDIR /app + +# Copy built app +COPY --from=builder /app/build ./build +COPY --from=builder /app/package.json ./ +COPY --from=builder /app/node_modules ./node_modules + +# Expose the port +ENV PORT=3000 +EXPOSE 3000 + +# Start the server +CMD ["node", "build/index.js"] \ No newline at end of file