Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (45 loc) · 2.39 KB
/
Copy pathDockerfile
File metadata and controls
59 lines (45 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM python:3.13-slim
# Install git and gh CLI dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
git curl && rm -rf /var/lib/apt/lists/*
# Install gh CLI
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
| dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
| tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \
apt-get update && apt-get install -y gh && rm -rf /var/lib/apt/lists/*
# Install Docker CLI + Compose plugin (no daemon in the image — the host's
# socket is mounted in, see docker-compose.yml)
RUN install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc && \
chmod a+r /etc/apt/keyrings/docker.asc && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
> /etc/apt/sources.list.d/docker.list && \
apt-get update && apt-get install -y --no-install-recommends \
docker-ce-cli docker-compose-plugin && rm -rf /var/lib/apt/lists/*
# Install Node.js (required for Claude Code CLI)
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs && rm -rf /var/lib/apt/lists/*
# Install Claude Code CLI
RUN npm install -g @anthropic-ai/claude-code
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Create non-root user (Claude Code CLI refuses --dangerously-skip-permissions as root)
RUN useradd -m -s /bin/bash clayde
ENV PATH="/opt/clayde/.venv/bin:$PATH"
WORKDIR /opt/clayde
# Install dependencies first (layer caching)
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev --no-install-project
# Copy source and install project
COPY src/ src/
COPY src/clayde/skills_builtin/ /skills/builtin/
COPY CLAUDE.md ./
RUN uv sync --frozen --no-dev
# Create data directories and set ownership
RUN mkdir -p /data/repos /data/logs && chown -R clayde:clayde /data
# Switch to non-root user and configure git credential helper
USER clayde
RUN mkdir -p /home/clayde/.claude && \
git config --global credential.helper '!gh auth git-credential'
ENTRYPOINT ["/opt/clayde/.venv/bin/clayde"]