-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDockerfile
More file actions
83 lines (66 loc) · 2.49 KB
/
Dockerfile
File metadata and controls
83 lines (66 loc) · 2.49 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Sugar Docker Image
FROM python:3.11-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Node.js and npm for Claude CLI
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs
# Install Claude CLI with retry logic and cache clearing
RUN npm cache clean --force && \
npm install -g @anthropic-ai/claude-code --no-cache || \
(sleep 5 && npm install -g @anthropic-ai/claude-code --registry https://registry.npmjs.org/)
# Create app directory
WORKDIR /app
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Install Sugar in development mode
RUN pip install -e .
# Create a non-root user
RUN useradd --create-home --shell /bin/bash sugar
RUN chown -R sugar:sugar /app
USER sugar
# Create directory for Sugar projects
RUN mkdir -p /home/sugar/projects
# Set working directory for projects
WORKDIR /home/sugar/projects
# Expose port for potential web interface
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD sugar --version || exit 1
# Default command - provides interactive shell for project setup
#
# USAGE:
# 1. Mount your project: docker run -v /path/to/project:/home/sugar/projects/my-project -it sugar
# 2. Navigate to project: cd my-project
# 3. Initialize Sugar: sugar init
# 4. Configure agents in .sugar/config.yaml (optional)
# 5. Start autonomous development: sugar run
#
# For Claude agent integration, configure your available agents in .sugar/config.yaml:
# claude:
# enable_agents: true
# available_agents: ["tech-lead", "code-reviewer", "my-custom-agent"]
CMD ["bash"]
# Labels
# Get version dynamically from pyproject.toml during build
ARG VERSION
ENV SUGAR_VERSION=${VERSION}
LABEL org.opencontainers.image.title="🍰 Sugar" \
org.opencontainers.image.description="🍰 Sugar - The autonomous layer for AI coding agents" \
org.opencontainers.image.url="https://github.com/roboticforce/sugar" \
org.opencontainers.image.source="https://github.com/roboticforce/sugar" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.authors="Steven Leggett <contact@roboticforce.io>"