Docker's build cache was preventing Portainer from picking up code changes. Adding a CACHEBUST ARG before COPY invalidates all subsequent layers when the value changes. Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
831 B
Docker
29 lines
831 B
Docker
FROM node:20-alpine AS builder
|
|
WORKDIR /app
|
|
|
|
# Copy package files for the worker
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --ignore-scripts
|
|
|
|
# Cache-bust: change CACHEBUST value in docker-compose.yml to force rebuild
|
|
ARG CACHEBUST=1
|
|
|
|
COPY . .
|
|
RUN npm run build
|
|
RUN npm prune --production
|
|
|
|
# ── Production image with FFmpeg ──────────────────────────────
|
|
FROM node:20-alpine AS production
|
|
WORKDIR /app
|
|
|
|
# Install FFmpeg
|
|
RUN apk add --no-cache ffmpeg
|
|
|
|
COPY --from=builder /app/package.json ./package.json
|
|
COPY --from=builder /app/package-lock.json ./package-lock.json
|
|
COPY --from=builder /app/dist ./dist
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
|
|
# The FFmpeg worker runs as a standalone BullMQ consumer
|
|
CMD ["node", "dist/ffmpeg-worker/worker.js"]
|