Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2c9868d
last one
dapperdivers Aug 19, 2025
c6b3a82
update perms
dapperdivers Aug 19, 2025
bc62df6
update pathing
dapperdivers Aug 19, 2025
dc8c540
updates for cache dir
dapperdivers Aug 19, 2025
6c176a7
Removed .env from tracking, added .env.example and updated .gitignore…
manageeverything Aug 30, 2025
c90cabe
Added .env.example and updated .gitignore to exclude .env and the CLA…
manageeverything Aug 30, 2025
4bd0256
Merge pull request #1 from stevepresley/feature/project-housekeeping
stevepresley Aug 30, 2025
47ae76d
Fix MCP Dockerfile directory path
manageeverything Aug 30, 2025
d69a29d
Merge pull request #2 from stevepresley/bugfix/resolve-build-action-f…
stevepresley Aug 30, 2025
3bcb711
Changed to use our repo instead of coleam00 to test changes in Docker
manageeverything Aug 31, 2025
5467f5c
Fix Docker builds to use pyproject.toml instead of requirements files
manageeverything Aug 31, 2025
fbf4cd8
Fix Python version requirement from 3.11 to 3.12
manageeverything Aug 31, 2025
3e37f1d
Fix server Dockerfile Python 3.12 path and Playwright installation
manageeverything Aug 31, 2025
f4c0a56
Fix Playwright installation to use Python module
manageeverything Aug 31, 2025
a62fc1f
Skip Playwright browser installation during Docker build
manageeverything Aug 31, 2025
74fcc9e
Properly fix Playwright installation with system dependencies
manageeverything Aug 31, 2025
eba7044
Use upstream Playwright installation approach
manageeverything Aug 31, 2025
04de015
Install Playwright in runtime stage to fix command not found error
manageeverything Aug 31, 2025
eec7865
Fix test script Docker Compose file paths
manageeverything Aug 31, 2025
71263c9
Fix docker-compose.test.yml paths for local testing
manageeverything Sep 1, 2025
55f04f1
Switch back to upstream coleam00/Archon repository
manageeverything Sep 1, 2025
ee70ac9
Clean up workflow comments
manageeverything Sep 1, 2025
e8c2920
Merge pull request #3 from stevepresley/localbuild
stevepresley Sep 1, 2025
468c854
Fix missing dependencies by installing specific dependency groups
manageeverything Sep 1, 2025
7ba3365
Remove redundant playwright installation in server Dockerfile
manageeverything Sep 1, 2025
1e4ad0e
Fix cross-service dependencies in Docker containers
manageeverything Sep 1, 2025
efeeded
Fix Docker build failures and improve documentation
manageeverything Sep 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Archon Docker Compose Environment Configuration
# This file contains environment variables for all services in the Archon stack

# =============================================================================
# Service Ports and Networking
# =============================================================================
HOST=0.0.0.0
LOG_LEVEL=INFO

# Frontend Service
VITE_PORT=5173
NODE_ENV=development

# Server Service
ARCHON_SERVER_PORT=8181
ARCHON_SERVER_HOST=archon-server

# Agents Service
ARCHON_AGENTS_PORT=8052

# MCP Service
ARCHON_MCP_PORT=8051

# =============================================================================
# Database Configuration
# =============================================================================
# Supabase Configuration (replace with your actual values)
SUPABASE_URL={your_supabase_url}
SUPABASE_ANON_KEY={your_supabase_anon_key}
SUPABASE_SERVICE_KEY={your_supabase_service_key}

# Alternative database URL format
DATABASE_URL=postgresql://user:password@host:port/database

# =============================================================================
# Security and Authentication
# =============================================================================
# Add your authentication keys here
# JWT_SECRET=your_jwt_secret_here
# API_KEY=your_api_key_here

# =============================================================================
# Feature Flags
# =============================================================================
PROJECTS_ENABLED=true

# =============================================================================
# Development/Testing Overrides
# =============================================================================
# Uncomment these for local development/testing
# SUPABASE_URL=http://localhost:54321
# SUPABASE_ANON_KEY=test_key
# SUPABASE_SERVICE_KEY=test_service_key

# =============================================================================
# Production Configuration
# =============================================================================
# For production deployments, set these values:
# NODE_ENV=production
# LOG_LEVEL=WARN
# Add your production database URLs and keys above
3 changes: 2 additions & 1 deletion .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
env:
REGISTRY: ghcr.io
UPSTREAM_REPO: coleam00/Archon

jobs:
build-images:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -107,6 +107,7 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
no-cache: true # Force rebuild to see actual dependency installation
cache-from: type=gha,scope=build-${{ matrix.component.name }}
cache-to: type=gha,mode=max,scope=build-${{ matrix.component.name }}
platforms: linux/amd64 # AMD64 only for faster builds
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ on:
default: false
type: boolean

env:
env:
UPSTREAM_REPO: coleam00/Archon

jobs:
check-for-updates:
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
logs/

# Environment variables
.env

# Claude
.claude/
CLAUDE.md
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,18 @@ services:
image: ghcr.io/yourusername/archon-mcp:latest
ports:
- "8051:8051"
environment:
- ARCHON_MCP_PORT=8051
- ARCHON_SERVER_PORT=8181
- ARCHON_AGENTS_PORT=8052
- VITE_PORT=5173

archon-agents:
image: ghcr.io/yourusername/archon-agents:latest
ports:
- "8052:8052"
environment:
- ARCHON_AGENTS_PORT=8052

archon-frontend:
image: ghcr.io/yourusername/archon-frontend:latest
Expand All @@ -104,10 +111,10 @@ services:
docker run -p 8181:8181 ghcr.io/yourusername/archon-server:latest

# Run MCP service
docker run -p 8051:8051 ghcr.io/yourusername/archon-mcp:latest
docker run -p 8051:8051 -e ARCHON_MCP_PORT=8051 -e ARCHON_SERVER_PORT=8181 -e ARCHON_AGENTS_PORT=8052 -e VITE_PORT=5173 ghcr.io/yourusername/archon-mcp:latest

# Run agents service
docker run -p 8052:8052 ghcr.io/yourusername/archon-agents:latest
docker run -p 8052:8052 -e ARCHON_AGENTS_PORT=8052 ghcr.io/yourusername/archon-agents:latest

# Run frontend - FIXED: Use consistent port mapping
docker run -p 5173:5173 ghcr.io/yourusername/archon-frontend:latest
Expand Down
48 changes: 24 additions & 24 deletions docker-compose.registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ services:
frontend:
image: ghcr.io/dapperdivers/archon-frontend:latest
ports:
- "5173:5173"
- "${VITE_PORT}:${VITE_PORT}"
environment:
- NODE_ENV=development
- HOST=0.0.0.0
- PORT=5173
- NODE_ENV=${NODE_ENV}
- HOST=${HOST}
- PORT=${VITE_PORT}
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:5173/health.html || exit 1"]
test: ["CMD-SHELL", "curl -f http://localhost:${VITE_PORT}/health.html || exit 1"]
interval: 30s
timeout: 10s
retries: 3
Expand All @@ -19,14 +19,14 @@ services:
agents:
image: ghcr.io/dapperdivers/archon-agents:latest
ports:
- "8052:8052"
- "${ARCHON_AGENTS_PORT}:${ARCHON_AGENTS_PORT}"
environment:
- HOST=0.0.0.0
- PORT=8052
- ARCHON_AGENTS_PORT=8052
- LOG_LEVEL=INFO
- HOST=${HOST}
- PORT=${ARCHON_AGENTS_PORT}
- ARCHON_AGENTS_PORT=${ARCHON_AGENTS_PORT}
- LOG_LEVEL=${LOG_LEVEL}
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8052/health || exit 1"]
test: ["CMD-SHELL", "curl -f http://localhost:${ARCHON_AGENTS_PORT}/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
Expand All @@ -35,15 +35,15 @@ services:
server:
image: ghcr.io/dapperdivers/archon-server:latest
ports:
- "8181:8181"
- "${ARCHON_SERVER_PORT}:${ARCHON_SERVER_PORT}"
environment:
- HOST=0.0.0.0
- PORT=8181
- ARCHON_SERVER_PORT=8181
- LOG_LEVEL=INFO
- SUPABASE_URL=https://localhost:54321
- SUPABASE_ANON_KEY=test_key
- SUPABASE_SERVICE_KEY=test_service_key
- HOST=${HOST}
- PORT=${ARCHON_SERVER_PORT}
- ARCHON_SERVER_PORT=${ARCHON_SERVER_PORT}
- LOG_LEVEL=${LOG_LEVEL}
- SUPABASE_URL=${SUPABASE_URL}
- SUPABASE_ANON_KEY=${SUPABASE_ANON_KEY}
- SUPABASE_SERVICE_KEY=${SUPABASE_SERVICE_KEY}
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8181/health || exit 1"]
interval: 30s
Expand All @@ -54,12 +54,12 @@ services:
mcp:
image: ghcr.io/dapperdivers/archon-mcp:latest
ports:
- "8051:8051"
- "${ARCHON_MCP_PORT}:${ARCHON_MCP_PORT}"
environment:
- HOST=0.0.0.0
- PORT=8051
- ARCHON_MCP_PORT=8051
- LOG_LEVEL=INFO
- HOST=${HOST}
- PORT=${ARCHON_MCP_PORT}
- ARCHON_MCP_PORT=${ARCHON_MCP_PORT}
- LOG_LEVEL=${LOG_LEVEL}
# Note: MCP service may not have a /health endpoint
healthcheck:
test: ["CMD-SHELL", "netstat -tuln | grep :8051 || exit 1"]
Expand Down
6 changes: 3 additions & 3 deletions dockerfiles/agents/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Fast single-stage agents build with security hardening
FROM python:3.11-slim
FROM python:3.12-slim

# Set proper environment defaults for Kubernetes
ENV HOST=0.0.0.0
Expand All @@ -20,8 +20,8 @@ RUN apt-get update && apt-get install -y \
&& apt-get clean

# Copy and install requirements from local source
COPY requirements.agents.txt .
RUN pip install --no-cache-dir -r requirements.agents.txt
COPY pyproject.toml uv.lock ./
RUN pip install --upgrade pip && pip install --no-cache-dir -e . --group agents --group server

# Copy application code
COPY . .
Expand Down
12 changes: 6 additions & 6 deletions dockerfiles/mcp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# MCP Service - Lightweight HTTP-based microservice
FROM python:3.11-slim
FROM python:3.12-slim

WORKDIR /app

Expand All @@ -11,14 +11,14 @@ RUN apt-get update && apt-get install -y \
&& apt-get clean

# Install dependencies
COPY requirements.mcp.txt .
RUN pip install --no-cache-dir -r requirements.mcp.txt
COPY pyproject.toml uv.lock ./
RUN pip install --upgrade pip && pip install --no-cache-dir -e . --group mcp --group server

# Create minimal directory structure
RUN mkdir -p src/mcp/modules src/server/services src/server/config
RUN mkdir -p src/mcp_server/modules src/server/services src/server/config

# Copy only MCP-specific files (lightweight protocol wrapper)
COPY src/mcp/ src/mcp/
COPY src/mcp_server/ src/mcp_server/
COPY src/__init__.py src/

# Copy only the minimal server files MCP needs for HTTP communication
Expand Down Expand Up @@ -54,4 +54,4 @@ EXPOSE ${ARCHON_MCP_PORT}
# Health check disabled - use TCP checks in Kubernetes instead

# Run the MCP server using module syntax (avoids naming conflicts)
CMD ["python", "-m", "src.mcp.mcp_server"]
CMD ["python", "-m", "src.mcp_server.mcp_server"]
69 changes: 50 additions & 19 deletions dockerfiles/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Fast single-stage server build with security hardening
FROM python:3.11-slim
# Server Service - Web crawling and document processing microservice with security hardening

# Build stage
FROM python:3.12 AS builder

WORKDIR /build

# Install build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*

# Copy and install Python dependencies
COPY pyproject.toml uv.lock ./
RUN pip install --upgrade pip && pip install --user --no-cache-dir -e . --group server

# Runtime stage
FROM python:3.12-slim

# Re-declare ARG for runtime stage
ARG BUILD_VERSION="2025-09-01T13:00:00Z-remove-manual-playwright"

WORKDIR /app

# Set proper environment defaults for Kubernetes
ENV HOST=0.0.0.0
Expand All @@ -8,13 +29,6 @@ ENV ARCHON_SERVER_PORT=8181
ENV LOG_LEVEL=INFO
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONPATH=/app:/app/src

WORKDIR /app

# Copy and install requirements from local source
COPY requirements.server.txt .
RUN pip install --no-cache-dir -r requirements.server.txt

# Install runtime dependencies for Playwright (minimal set)
RUN apt-get update && apt-get install -y \
Expand Down Expand Up @@ -42,28 +56,45 @@ RUN apt-get update && apt-get install -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Copy Python packages from builder
COPY --from=builder /root/.local /root/.local

# Ensure playwright browsers are available
ENV PATH=/root/.local/bin:$PATH
ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers
ENV PYTHONPATH="/root/.local/lib/python3.12/site-packages"
# Install playwright browsers (playwright itself comes from crawl4ai dependency)
RUN echo "=== BUILD VERSION: ${BUILD_VERSION} ===" && \
mkdir -p /opt/playwright-browsers && \
python -m playwright install chromium && \
chmod -R 755 /opt/playwright-browsers

# Copy application code
COPY . .
# Copy server code and tests (selective copying like upstream)
COPY src/server/ src/server/
COPY src/__init__.py src/
COPY tests/ tests/

# Create non-root user first
# Create non-root user for runtime security
RUN addgroup --gid 1001 archon && \
adduser --disabled-password --gecos '' --uid 1001 --gid 1001 archon && \
chown -R archon:archon /app
# Create home directory structure
mkdir -p /home/archon/.cache && \
chown -R archon:archon /app /home/archon && \
# Allow non-root user access to Python packages in /root/.local
chmod -R 755 /root/.local && \
chmod 755 /root

# Switch to non-root user and install Playwright browsers for this user
# Switch to non-root user for runtime
USER 1001
ENV HOME=/home/archon

# Install Playwright browsers as the archon user so they're accessible at runtime
RUN python -m playwright install chromium
ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers
ENV PYTHONPATH="/app:/root/.local/lib/python3.12/site-packages:$PYTHONPATH"

EXPOSE ${ARCHON_SERVER_PORT}

# Health check using Python (faster than curl for our use case)
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD python -c "import urllib.request, os; urllib.request.urlopen(f'http://localhost:{os.environ[\"ARCHON_SERVER_PORT\"]}/health').read()" || exit 1

# Run the server with configurable port (matching original Archon structure)
CMD sh -c "python -m uvicorn src.server.main:socket_app --host 0.0.0.0 --port ${ARCHON_SERVER_PORT} --workers 1"
# Run the server with configurable port (using JSON array format for better signal handling)
CMD ["sh", "-c", "python -m uvicorn src.server.main:socket_app --host 0.0.0.0 --port ${ARCHON_SERVER_PORT} --workers 1"]
Loading