Remodel/packages/web/Dockerfile
Mannu 01c1a9682f
Some checks are pending
CI / Engine — lint / typecheck / test (push) Waiting to run
CI / API — lint / typecheck / test (push) Waiting to run
CI / Web — typecheck / lint / build (push) Waiting to run
Fix web: add node_modules/.bin to PATH
2026-05-13 22:00:50 +05:30

42 lines
No EOL
928 B
Docker

FROM node:22-alpine AS builder
WORKDIR /app
# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
# Copy web package
COPY package.json pnpm-lock.yaml ./
COPY . .
# Create placeholder .env.local if not exists (needed for prod build)
RUN test -f .env.local || echo "# placeholder" > .env.local
# Install dependencies
RUN pnpm install --frozen-lockfile --ignore-scripts
# Build
RUN pnpm build
# Production runner
FROM node:22-alpine
WORKDIR /app
# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
# Copy built artifacts
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json .
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/.env.local ./.env.local
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV PATH=/app/node_modules/.bin:$PATH
EXPOSE 3000
CMD ["next", "start"]