- Dockerfile: multi-stage build (node:22-alpine builds Vue SPA, python:3.12-slim runs uvicorn) — no Node.js required on the host - requirements.txt: minimal runtime deps (fastapi, uvicorn, pyyaml, aiofiles, pydantic, python-multipart) - podman-standalone.sh: mirrors Peregrine's deployment pattern; binds /opt/turnstone/data + /opt/turnstone/patterns + /opt/qbittorrent/config/data/logs (ro); includes cron and Caddy config instructions in comments - .gitignore: add log/, .turnstone-api.pid (generated by manage.sh dev mode)
36 lines
1.3 KiB
Docker
36 lines
1.3 KiB
Docker
# ── Stage 1: Build Vue SPA ────────────────────────────────────────────────────
|
|
FROM node:22-alpine AS web-builder
|
|
WORKDIR /web
|
|
COPY web/package.json web/package-lock.json ./
|
|
RUN npm ci
|
|
COPY web/ ./
|
|
RUN npm run build
|
|
|
|
# ── Stage 2: Python runtime ───────────────────────────────────────────────────
|
|
FROM python:3.12-slim
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY app/ ./app/
|
|
COPY patterns/ ./patterns/
|
|
COPY scripts/ ./scripts/
|
|
COPY --from=web-builder /web/dist ./web/dist
|
|
|
|
# Volume mount points — override at runtime:
|
|
# /data/ → TURNSTONE_DB=/data/turnstone.db (read-write)
|
|
# /patterns/ → custom pattern YAML files (read-write)
|
|
# /logs/ → host log directories (read-only)
|
|
ENV TURNSTONE_DB=/data/turnstone.db
|
|
|
|
EXPOSE 8534
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=20s --retries=3 \
|
|
CMD curl -f http://localhost:8534/turnstone/health || exit 1
|
|
|
|
CMD ["uvicorn", "app.rest:app", "--host", "0.0.0.0", "--port", "8534"]
|