Files
tonemark/Dockerfile
T
Giancarmine SalucciandClaude Haiku 4.5 204848ddae
Build & Push Docker Image / test (push) Failing after 11s
Build & Push Docker Image / build-and-push (push) Has been skipped
fix: infrastructure for prod-parity deployment
Added db schema migration script (scripts/migrate.js) for fresh deployments,
updated Dockerfile to include scripts directory, and fixed job-progress test
to include newly added retry fields after D3 foundation merge.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-08 01:25:52 +02:00

46 lines
1.4 KiB
Docker

# syntax=docker/dockerfile:1
# ── Stage 1: build ──────────────────────────────────────────────────────────
FROM node:22-alpine AS builder
WORKDIR /app
# Install dependencies first (better layer caching)
COPY package.json package-lock.json ./
RUN npm install
# Copy source and build
COPY . .
RUN npm run build
# Prune dev dependencies
RUN npm prune --production
# ── Stage 2: runtime ─────────────────────────────────────────────────────────
FROM node:22-alpine AS runtime
WORKDIR /app
# Runtime tools + timezone data
# yt-dlp prebuilt binary requires glibc; Alpine uses musl → install via pip instead
RUN apk add --no-cache ffmpeg tzdata python3 py3-pip && \
pip3 install --no-cache-dir --break-system-packages yt-dlp
# Copy built output and production node_modules
# node:22-alpine ships with user node (uid=1000, gid=1000)
COPY --from=builder --chown=node:node /app/build ./build
COPY --from=builder --chown=node:node /app/node_modules ./node_modules
COPY --from=builder --chown=node:node /app/package.json ./
COPY --from=builder --chown=node:node /app/scripts ./scripts
USER node
EXPOSE 3000
ENV NODE_ENV=production \
PORT=3000 \
HOST=0.0.0.0 \
TZ=Europe/Zurich
CMD ["node", "build/index.js"]