Files
svgl/Dockerfile
T
pheralb 25ce756481
📦 Build / 🛠️ Build app (push) Has been cancelled
🧑‍🚀 Check / ⚙️ Linting (push) Has been cancelled
🧑‍🚀 Check / 📦 SVGs Size (push) Has been cancelled
🐋 Add size check before production build
2025-09-16 14:08:40 +01:00

39 lines
794 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 . .
ENV PUBLIC_SVGL_VERSION=beta
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
ENV PUBLIC_SVGL_VERSION=beta
# Expose port
EXPOSE 3000
# Start the server
CMD ["node", "build"]