forked from preset-io/agor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
58 lines (47 loc) · 2.05 KB
/
Dockerfile.dev
File metadata and controls
58 lines (47 loc) · 2.05 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
# Development Dockerfile for Agor
# Supports hot-reload for both daemon and UI
FROM node:20-slim
# Install system dependencies (including git for repo cloning)
RUN apt-get update && apt-get install -y \
sqlite3 \
git \
curl \
sudo \
&& rm -rf /var/lib/apt/lists/*
# Install GitHub CLI (gh) - download pre-built binary
RUN curl -fsSL "$(curl -s https://api.github.com/repos/cli/cli/releases/latest | grep 'browser_download_url.*linux_amd64.tar.gz"' | cut -d'"' -f4)" | \
tar -xz -C /tmp && \
mv /tmp/gh_*/bin/gh /usr/local/bin/ && \
rm -rf /tmp/gh_*
# Install pnpm and AI coding agent CLIs (always get latest versions)
RUN npm install -g pnpm@latest @anthropic-ai/claude-code@latest @google/gemini-cli@latest @openai/codex@latest
# Create non-root 'agor' user for development
RUN useradd -m -s /bin/bash agor && \
# Grant passwordless sudo for fixing volume permissions
echo "agor ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/agor && \
chmod 0440 /etc/sudoers.d/agor && \
# Create .agor directory for database and config (will be mounted as volume)
mkdir -p /home/agor/.agor && \
chown -R agor:agor /home/agor
# Set working directory
WORKDIR /app
# Copy package files for dependency installation (as root, then chown)
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY apps/agor-daemon/package.json ./apps/agor-daemon/
COPY apps/agor-cli/package.json ./apps/agor-cli/
COPY apps/agor-ui/package.json ./apps/agor-ui/
COPY packages/core/package.json ./packages/core/
# Install dependencies as agor user (cached in Docker layer)
# This creates node_modules with correct platform binaries for container
RUN chown -R agor:agor /app && \
su agor -c 'yes | pnpm install --frozen-lockfile'
# Copy entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \
chown agor:agor /usr/local/bin/docker-entrypoint.sh
# Expose UI port only (daemon is internal)
EXPOSE ${VITE_PORT:-5173}
# Switch to agor user
USER agor
# Use entrypoint script to start both processes
ENTRYPOINT ["docker-entrypoint.sh"]