diff --git a/Dockerfile b/Dockerfile index d99c800..a23704d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,14 +22,18 @@ COPY . . RUN pnpm build # Production image -FROM base AS runner -COPY --from=deps /app/node_modules ./node_modules -COPY --from=builder /app/dist ./dist +FROM nginx:alpine AS runner +COPY --from=builder /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf + +# Create videos directory +RUN mkdir -p /usr/share/nginx/html/videos + # Copy specific directories from public -COPY --from=builder /app/public/images ./dist/images -COPY --from=builder /app/public/subtitles ./dist/subtitles -COPY --from=builder /app/public/transcriptions ./dist/transcriptions -COPY package.json ./ +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 EXPOSE 804 -CMD ["pnpm", "preview", "--port", "804", "--host"] + +CMD ["nginx", "-g", "daemon off;"] diff --git a/docker-compose.yml b/docker-compose.yml index 5180513..4fcf84c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: volumes: - type: bind source: /docker/websites/deafgain/video_content - target: /app/dist/videos + target: /usr/share/nginx/html/videos environment: - NODE_ENV=production - PORT=804