mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
CRITICAL FIX: Electron and web mode were using DIFFERENT data directories: - Electron: Docker volume 'automaker-data' (isolated from host) - Web: Local ./data directory (host filesystem) This caused projects opened in Electron to never appear in web mode because they were synced to a completely separate Docker volume. Solution: Mount the host's ./data directory into both containers This ensures Electron and web mode always share the same data directory and all projects are immediately visible across modes. Now when you: 1. Open projects in Electron → synced to ./data 2. Switch to web mode → loads from same ./data 3. Restart server → both see the same projects Fixes issue where projects opened in Electron don't appear in web mode. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
107 lines
3.5 KiB
YAML
107 lines
3.5 KiB
YAML
# Automaker Docker Compose - Server Only (Development Mode)
|
|
# Runs only the backend API in a container for use with local Electron.
|
|
#
|
|
# Usage:
|
|
# docker compose -f docker-compose.dev-server.yml up
|
|
# Then run Electron locally which connects to http://localhost:3008
|
|
#
|
|
# This mode:
|
|
# - Runs only the backend server in a container
|
|
# - Mounts source code as volumes (live reload)
|
|
# - Server runs with tsx watch for TypeScript changes
|
|
# - Electron runs locally on host machine
|
|
|
|
services:
|
|
# Development server (backend API only)
|
|
server:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.dev
|
|
args:
|
|
# Match container user to host user for mounted volume permissions
|
|
# Override with: UID=$(id -u) GID=$(id -g) docker-compose build
|
|
UID: ${UID:-1001}
|
|
GID: ${GID:-1001}
|
|
container_name: automaker-dev-server-only
|
|
restart: unless-stopped
|
|
ports:
|
|
- '3008:3008'
|
|
environment:
|
|
# Optional - Anthropic API key
|
|
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
|
|
|
|
# Optional - Claude CLI OAuth credentials
|
|
- CLAUDE_OAUTH_CREDENTIALS=${CLAUDE_OAUTH_CREDENTIALS:-}
|
|
|
|
# Optional - Cursor CLI OAuth token
|
|
- CURSOR_AUTH_TOKEN=${CURSOR_AUTH_TOKEN:-}
|
|
|
|
# Optional - authentication
|
|
- AUTOMAKER_API_KEY=${AUTOMAKER_API_KEY:-}
|
|
|
|
# Development settings
|
|
- NODE_ENV=development
|
|
- PORT=3008
|
|
- CORS_ORIGIN=http://localhost:3007
|
|
- HUSKY=0
|
|
|
|
# Optional - restrict to specific directory within container
|
|
- ALLOWED_ROOT_DIRECTORY=${ALLOWED_ROOT_DIRECTORY:-/projects}
|
|
- DATA_DIR=/data
|
|
|
|
# Internal - indicates containerized environment
|
|
- IS_CONTAINERIZED=true
|
|
volumes:
|
|
# Mount source code for live reload
|
|
- .:/app:cached
|
|
|
|
# Use named volume for node_modules to avoid platform conflicts
|
|
# This ensures native modules are built for the container's architecture
|
|
- automaker-dev-node-modules:/app/node_modules
|
|
|
|
# IMPORTANT: Mount local ./data directory (not a Docker volume)
|
|
# This ensures Electron and web mode share the same data directory
|
|
# and projects opened in either mode are visible in both
|
|
- ./data:/data
|
|
|
|
# Persist CLI configurations
|
|
- automaker-claude-config:/home/automaker/.claude
|
|
- automaker-cursor-config:/home/automaker/.cursor
|
|
|
|
# Note: Workspace mount (/projects) comes from docker-compose.override.yml
|
|
|
|
# Install deps, build packages, then start server in watch mode
|
|
# Note: We override the entrypoint to handle permissions properly
|
|
entrypoint: /bin/sh
|
|
command:
|
|
- -c
|
|
- |
|
|
# Install as root to avoid permission issues with named volumes
|
|
# Use --force to skip platform-specific devDependencies (dmg-license is macOS-only)
|
|
echo 'Installing dependencies...' &&
|
|
npm ci --legacy-peer-deps --force &&
|
|
echo 'Building shared packages...' &&
|
|
npm run build:packages &&
|
|
|
|
# Fix permissions and start server as automaker user
|
|
chown -R automaker:automaker /app/node_modules &&
|
|
echo 'Starting server in development mode...' &&
|
|
exec gosu automaker npm run _dev:server
|
|
healthcheck:
|
|
test: ['CMD', 'curl', '-f', 'http://localhost:3008/api/health']
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 60s
|
|
|
|
volumes:
|
|
automaker-dev-node-modules:
|
|
name: automaker-dev-node-modules
|
|
# Named volume for container-specific node_modules
|
|
|
|
automaker-claude-config:
|
|
name: automaker-claude-config
|
|
|
|
automaker-cursor-config:
|
|
name: automaker-cursor-config
|