Update copying order
This commit is contained in:
parent
4c0fde6415
commit
f56c7ab126
1 changed files with 12 additions and 5 deletions
17
Dockerfile
17
Dockerfile
|
|
@ -2,8 +2,11 @@ FROM node:20-alpine AS base
|
|||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
WORKDIR /app
|
||||
|
||||
# Copy all source files first
|
||||
COPY . .
|
||||
# Create all required directories
|
||||
RUN mkdir -p public/images public/subtitles public/transcriptions
|
||||
|
||||
# Copy package files first
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
# Install dependencies
|
||||
FROM base AS deps
|
||||
|
|
@ -12,11 +15,18 @@ RUN pnpm install --frozen-lockfile
|
|||
# Build the app
|
||||
FROM base AS builder
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
RUN pnpm build
|
||||
|
||||
# Production image
|
||||
FROM nginx:alpine AS runner
|
||||
|
||||
# Create all required directories in nginx
|
||||
RUN mkdir -p /usr/share/nginx/html/images \
|
||||
/usr/share/nginx/html/subtitles \
|
||||
/usr/share/nginx/html/transcriptions \
|
||||
/usr/share/nginx/html/videos
|
||||
|
||||
# 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
|
||||
|
|
@ -24,9 +34,6 @@ 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
|
||||
RUN mkdir -p /usr/share/nginx/html/videos
|
||||
|
||||
EXPOSE 804
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue