Files
svgl/Dockerfile
T
2025-09-24 14:17:01 +01:00

37 lines
736 B
Docker

FROM node:22.17.0-alpine AS base
# Install pnpm
RUN npm install -g pnpm@10.13.1
# Set working directory
WORKDIR /app
# Install dependencies with cache
FROM base AS deps
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Build the application
FROM base AS builder
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN pnpm run check:size
RUN pnpm run build:prod
# Production image
FROM node:22.17.0-alpine AS runner
WORKDIR /app
# Copy necessary files from builder
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules
COPY package.json ./
# Set production environment
ENV NODE_ENV=production
# Expose port
EXPOSE 3000
# Start the server
CMD ["node", "build"]