vortex / Dockerfile
anujjoshi3105's picture
first commit
3d23b0f
raw
history blame contribute delete
699 Bytes
# Stage 1: Build
FROM node:20-alpine AS builder
# Install pnpm
RUN npm install -g pnpm
WORKDIR /app
# Copy package files
COPY package.json pnpm-lock.yaml ./
# Install dependencies
RUN pnpm install --frozen-lockfile
# Copy source code
COPY . .
# Build the application
RUN pnpm run build
# Stage 2: Production
FROM node:20-alpine
# Install pnpm
RUN npm install -g pnpm
WORKDIR /app
# Copy package files
COPY package.json pnpm-lock.yaml ./
# Install only production dependencies
RUN pnpm install --prod --frozen-lockfile
# Copy built artifacts from builder stage
COPY --from=builder /app/dist ./dist
# Expose the application port
EXPOSE 3000
# Start the application
CMD ["pnpm", "start"]