Fix docker related issues

This commit is contained in:
TheMaddax 2024-12-09 18:18:49 -06:00
parent 620666e7f1
commit 0823a15744
2 changed files with 13 additions and 9 deletions

View file

@ -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;"]

View file

@ -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