Files
infra/stacks/books/Dockerfile
T

26 lines
1.2 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# books.ruzzy.dev — читалка с ИИ. ИИ — Claude Code в фоновом режиме по подписке владельца (CLAUDE_CODE_OAUTH_TOKEN).
FROM python:3.12-slim
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
# uid 1000 = rus на fr1: ./data на хосте принадлежит ему, chown не нужен
RUN useradd -m -u 1000 app
USER app
# Claude Code — нативный установщик с фиксированной версией (как в claude-channels); автообновление выключено
RUN curl -fsSL https://claude.ai/install.sh | bash -s 2.1.197
ENV PATH=/home/app/.local/bin:$PATH \
CLAUDE_BIN=/home/app/.local/bin/claude \
DISABLE_AUTOUPDATER=1 \
DISABLE_TELEMETRY=1 \
CLAUDE_CONFIG_DIR=/data/claude \
BOOKS_DATA=/data \
PYTHONUNBUFFERED=1
COPY --chown=app app /app
WORKDIR /app
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--proxy-headers", "--forwarded-allow-ips", "*", "--timeout-keep-alive", "75"]