jsoncrack.com/Dockerfile

22 lines
525 B
Docker
Raw Normal View History

2024-10-31 17:59:48 +03:00
FROM node:lts-alpine AS base
2024-10-31 17:59:48 +03:00
# Stage 1: Install dependencies
FROM base AS deps
WORKDIR /app
2023-12-24 13:59:30 +03:00
COPY package.json pnpm-lock.yaml ./
2024-10-31 17:59:48 +03:00
RUN corepack enable pnpm && pnpm install --frozen-lockfile
2024-10-31 17:59:48 +03:00
# Stage 2: Build the application
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN corepack enable pnpm && pnpm run build
2024-10-31 17:59:48 +03:00
# Stage 3: Production image
FROM nginx:stable AS production
WORKDIR /app
COPY --from=builder /app/out /app
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80