Files
insta-recipe/Dockerfile
Giancarmine Salucci 97355d859f
Some checks failed
Build & Push Docker Image / test-and-build (push) Failing after 38s
ci: multi-stage Dockerfile + fix workflow to match runner pattern
- Add tester/builder/runner stages to Dockerfile
- Use docker/build-push-action@v6 (matches other repos)
- Run tests via Docker tester stage (no setup-node needed)
- Fix secret names: REGISTRY_USERNAME / REGISTRY_TOKEN
- Runner target: keep yt-dlp + Chromium, copy only build artifacts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-12 20:53:35 +02:00

42 lines
1.4 KiB
Docker

# ── stage: tester ────────────────────────────────────────────────────────────
FROM node:24-alpine AS tester
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm test
# ── stage: builder ───────────────────────────────────────────────────────────
FROM node:24-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# ── stage: runner ────────────────────────────────────────────────────────────
FROM node:24-alpine AS runner
WORKDIR /app
# Install yt-dlp (primary Instagram extractor) and Playwright system dependencies (fallback)
RUN apk add --no-cache \
python3 \
py3-pip \
chromium \
font-liberation \
font-noto \
font-noto-cjk && \
pip3 install --break-system-packages yt-dlp
COPY package*.json ./
RUN npm ci --omit=dev
COPY --from=builder /app/build ./build
EXPOSE 3000
ENV NODE_ENV=production
ENV CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium-browser
# Declare volume for Instagram authentication persistence
VOLUME ["/app/secrets"]
CMD ["node", "-e", "import('./build/index.js')"]