This repository has been archived on 2026-02-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
serengo/Dockerfile
2025-12-16 12:59:43 +01:00

47 lines
737 B
Docker

# Build stage
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 app
RUN pnpm run build
# Production stage
FROM node:20-alpine
# Install pnpm
RUN npm install -g pnpm
WORKDIR /app
# Copy package files
COPY package.json pnpm-lock.yaml ./
# Install production dependencies only
RUN pnpm install --prod --frozen-lockfile
# Copy built app from builder
COPY --from=builder /app/build ./build
# Expose port
EXPOSE 3000
# Set environment variables
ENV NODE_ENV=production
ENV ORIGIN=http://localhost:3000
# Start the app
CMD ["node", "build"]