65 lines
2.6 KiB
Docker
65 lines
2.6 KiB
Docker
# ─────────────────────────────────────────────────────────
|
|
# Recap Relay — StartOS 0.4 Docker image
|
|
#
|
|
# Includes: Node.js 20 only. No yt-dlp / ffmpeg / Python — the relay
|
|
# receives audio buffers from Recap clients and forwards to Gemini's
|
|
# File API; no local audio processing.
|
|
#
|
|
# Uses Debian slim for the same reason Recap does — pip-free, but
|
|
# pulled-in C deps from npm packages prefer glibc over musl.
|
|
# ─────────────────────────────────────────────────────────
|
|
|
|
# ── Stage 1: install dependencies ──────────────────────────
|
|
FROM node:20-slim AS builder
|
|
|
|
# @keysat/licensing-client is vendored from a private git repo into
|
|
# vendor/keysat-licensing-client. Install its deps in place first so
|
|
# the file: dep on it works downstream.
|
|
WORKDIR /app
|
|
COPY vendor/keysat-licensing-client /app/vendor/keysat-licensing-client
|
|
WORKDIR /app/vendor/keysat-licensing-client
|
|
RUN npm install --omit=dev --ignore-scripts
|
|
|
|
WORKDIR /app/server
|
|
COPY server/package.json server/package-lock.json* ./
|
|
RUN npm ci --omit=dev --ignore-scripts 2>/dev/null || npm install --omit=dev --ignore-scripts
|
|
|
|
# ── Stage 2: final runtime image ───────────────────────────
|
|
FROM node:20-slim AS runner
|
|
|
|
WORKDIR /app
|
|
|
|
# Runtime deps:
|
|
# - dumb-init: PID 1 signal handling
|
|
# - ca-certificates: HTTPS for Gemini + Keysat
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
dumb-init \
|
|
ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy installed deps + app code from builder
|
|
COPY --from=builder /app/vendor ./vendor/
|
|
COPY --from=builder /app/server/node_modules ./server/node_modules/
|
|
COPY server/package.json ./server/
|
|
# Top-level *.js files (index.js, config.js, credits.js, admin-auth.js,
|
|
# job-credits.js, keysat-client.js) plus the backends/ + routes/
|
|
# subdirectories. Anything added under server/<subdir>/ needs its own
|
|
# COPY line — the glob doesn't recurse.
|
|
COPY server/*.js ./server/
|
|
COPY server/backends/ ./server/backends/
|
|
COPY server/routes/ ./server/routes/
|
|
COPY public/ ./public/
|
|
|
|
COPY docker_entrypoint.sh /usr/local/bin/docker_entrypoint.sh
|
|
RUN chmod +x /usr/local/bin/docker_entrypoint.sh
|
|
|
|
RUN mkdir -p /data
|
|
|
|
ENV NODE_ENV=production \
|
|
PORT=3002 \
|
|
DATA_DIR=/data
|
|
|
|
EXPOSE 3002
|
|
|
|
ENTRYPOINT ["dumb-init", "--", "/usr/local/bin/docker_entrypoint.sh"]
|