Advertisement

← refacto-feature-scout

Dockerfile

1.7 KB Download file
# Feature Scout on Fly.io — one small always-on machine running the cron loop.
# Needs: python (the scout), node (the apps' test suites + the Claude Code CLI),
# git (Library Mode), flyctl (deploys), supercronic (cron), litestream (SQLite backup).
FROM python:3.12-slim

ENV PYTHONUNBUFFERED=1 PIP_DISABLE_PIP_VERSION_CHECK=1 DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
        git curl ca-certificates build-essential pkg-config \
    && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
    && apt-get install -y --no-install-recommends nodejs \
    && rm -rf /var/lib/apt/lists/*

# Claude Code CLI (headless `claude -p`), pinned to the version verified on the Mac.
ARG CLAUDE_CODE_VERSION=2.1.260
RUN npm install -g "@anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}" && claude --version

# flyctl for `fly deploy --remote-only` of the apps.
RUN curl -L https://fly.io/install.sh | sh
ENV PATH="/root/.fly/bin:${PATH}"

ARG SUPERCRONIC_VERSION=0.2.33
RUN curl -fsSL -o /usr/local/bin/supercronic \
      "https://github.com/aptible/supercronic/releases/download/v${SUPERCRONIC_VERSION}/supercronic-linux-amd64" \
    && chmod +x /usr/local/bin/supercronic && supercronic -version

ARG LITESTREAM_VERSION=0.3.13
RUN curl -fsSL "https://github.com/benbjohnson/litestream/releases/download/v${LITESTREAM_VERSION}/litestream-v${LITESTREAM_VERSION}-linux-amd64.tar.gz" \
    | tar -xz -C /usr/local/bin litestream && litestream version

WORKDIR /app
COPY pyproject.toml README.md ./
COPY scout ./scout
RUN pip install -e .
COPY cloud ./cloud
COPY litestream.yml ./litestream.yml
RUN chmod +x cloud/entrypoint.sh cloud/job.sh

ENTRYPOINT ["/app/cloud/entrypoint.sh"]