-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (51 loc) · 2.19 KB
/
Dockerfile
File metadata and controls
67 lines (51 loc) · 2.19 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
60
61
62
63
64
65
66
67
FROM node:22-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
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 \
&& chmod go+r /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 pnpm
RUN corepack enable && corepack prepare pnpm@10.11.0 --activate
# Install Claude Code CLI globally
RUN npm install -g @anthropic-ai/claude-code
# Install Playwright and Chromium
RUN npx playwright install --with-deps chromium
WORKDIR /app
# Copy package files and install deps
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Copy source
COPY . .
# Build backend
RUN pnpm build
# Build admin frontend
RUN cd web && pnpm install --frozen-lockfile && pnpm build
# All persistent data under /data (single Railway volume)
# /data/db/ — SQLite database
# /data/repos/ — Cloned git repositories
# /data/claude/ — Claude CLI auth tokens
RUN mkdir -p /data/db /data/repos /data/claude
# Create non-root user (Claude CLI refuses --dangerously-skip-permissions as root)
RUN useradd -m -s /bin/bash claude \
&& chown -R claude:claude /app /data
# Rewrite SSH git URLs to HTTPS and configure token auth (as claude user)
USER claude
RUN git config --global url."https://github.com/".insteadOf "git@github.com:" \
&& git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" \
&& git config --global credential.helper '!f() { echo "username=x-access-token"; echo "password=${GITHUB_TOKEN}"; }; f'
ENV DB_PATH=/data/db/task-runner.db
ENV WORK_DIR=/data/repos
ENV HOME=/home/claude
EXPOSE 3000
# Entrypoint runs as root to fix volume permissions, then drops to claude user
USER root
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]