Copy all source first

This commit is contained in:
TheMaddax 2024-12-09 18:41:11 -06:00
parent 545b49b65f
commit 4c0fde6415

View file

@ -2,8 +2,8 @@ FROM node:20-alpine AS base
RUN corepack enable && corepack prepare pnpm@latest --activate RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app WORKDIR /app
# Copy package files # Copy all source files first
COPY package.json pnpm-lock.yaml* ./ COPY . .
# Install dependencies # Install dependencies
FROM base AS deps FROM base AS deps
@ -12,15 +12,13 @@ RUN pnpm install --frozen-lockfile
# Build the app # Build the app
FROM base AS builder FROM base AS builder
COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN pnpm build RUN pnpm build
# Production image # Production image
FROM nginx:alpine AS runner FROM nginx:alpine AS runner
# Copy built app # Copy built app and static assets
COPY --from=builder /app/dist /usr/share/nginx/html COPY --from=builder /app/dist /usr/share/nginx/html
# Copy static assets from the builder stage
COPY --from=builder /app/public/images /usr/share/nginx/html/images COPY --from=builder /app/public/images /usr/share/nginx/html/images
COPY --from=builder /app/public/subtitles /usr/share/nginx/html/subtitles COPY --from=builder /app/public/subtitles /usr/share/nginx/html/subtitles
COPY --from=builder /app/public/transcriptions /usr/share/nginx/html/transcriptions COPY --from=builder /app/public/transcriptions /usr/share/nginx/html/transcriptions