Fix assets to be included
This commit is contained in:
parent
f56c7ab126
commit
a09c831b2e
2 changed files with 31 additions and 6 deletions
|
|
@ -2,4 +2,7 @@ node_modules
|
|||
dist
|
||||
.git
|
||||
*.log
|
||||
public/
|
||||
public/videos/*
|
||||
!public/videos/.gitkeep
|
||||
**/.DS_Store
|
||||
|
||||
|
|
|
|||
32
Dockerfile
32
Dockerfile
|
|
@ -2,8 +2,8 @@ FROM node:20-alpine AS base
|
|||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
WORKDIR /app
|
||||
|
||||
# Create all required directories
|
||||
RUN mkdir -p public/images public/subtitles public/transcriptions
|
||||
# Create required directories
|
||||
RUN mkdir -p public/images/thumbnails public/subtitles public/transcriptions
|
||||
|
||||
# Copy package files first
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
|
@ -16,24 +16,46 @@ RUN pnpm install --frozen-lockfile
|
|||
FROM base AS builder
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
# Verification steps with output to file
|
||||
RUN echo "=== BUILDER STAGE: Verifying source files ===" > /verification.txt && \
|
||||
echo "Contents of /app/public:" >> /verification.txt && \
|
||||
ls -la /app/public >> /verification.txt && \
|
||||
echo "\nContents of /app/public/images:" >> /verification.txt && \
|
||||
ls -la /app/public/images >> /verification.txt && \
|
||||
echo "\nContents of /app/public/images/thumbnails:" >> /verification.txt && \
|
||||
ls -la /app/public/images/thumbnails >> /verification.txt && \
|
||||
echo "\nAll files under public:" >> /verification.txt && \
|
||||
find /app/public -type f >> /verification.txt
|
||||
RUN pnpm build
|
||||
|
||||
# Production image
|
||||
FROM nginx:alpine AS runner
|
||||
|
||||
# Create all required directories in nginx
|
||||
RUN mkdir -p /usr/share/nginx/html/images \
|
||||
# Create required directories
|
||||
RUN mkdir -p /usr/share/nginx/html/images/thumbnails \
|
||||
/usr/share/nginx/html/subtitles \
|
||||
/usr/share/nginx/html/transcriptions \
|
||||
/usr/share/nginx/html/videos
|
||||
|
||||
# Copy verification file from builder
|
||||
COPY --from=builder /verification.txt /verification.txt
|
||||
|
||||
# Copy built app and static assets
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
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/transcriptions /usr/share/nginx/html/transcriptions
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Add runner stage verification to the file
|
||||
RUN echo "\n=== RUNNER STAGE: Verifying nginx html directory structure ===" >> /verification.txt && \
|
||||
echo "Contents of /usr/share/nginx/html:" >> /verification.txt && \
|
||||
ls -la /usr/share/nginx/html >> /verification.txt && \
|
||||
echo "\nContents of /usr/share/nginx/html/images:" >> /verification.txt && \
|
||||
ls -la /usr/share/nginx/html/images >> /verification.txt && \
|
||||
echo "\nAll files under html:" >> /verification.txt && \
|
||||
find /usr/share/nginx/html -type f >> /verification.txt
|
||||
|
||||
EXPOSE 804
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue