From 545b49b65f260b619d02513f52d8ef9bcb46e23c Mon Sep 17 00:00:00 2001 From: TheMaddax Date: Mon, 9 Dec 2024 18:39:02 -0600 Subject: [PATCH] add builder --- Dockerfile | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6362840..ec6f79c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,6 @@ FROM node:20-alpine AS base RUN corepack enable && corepack prepare pnpm@latest --activate WORKDIR /app -# Create required directories -RUN mkdir -p /app/public/images/thumbnails \ - /app/public/videos \ - /app/public/subtitles \ - /app/public/transcriptions - # Copy package files COPY package.json pnpm-lock.yaml* ./ @@ -24,11 +18,12 @@ RUN pnpm build # Production image FROM nginx:alpine AS runner -# Copy built app and static assets +# Copy built app COPY --from=builder /app/dist /usr/share/nginx/html -COPY public/images /usr/share/nginx/html/images -COPY public/subtitles /usr/share/nginx/html/subtitles -COPY public/transcriptions /usr/share/nginx/html/transcriptions +# Copy static assets from the builder stage +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/transcriptions /usr/share/nginx/html/transcriptions COPY nginx.conf /etc/nginx/conf.d/default.conf # Create videos directory for volume mount