name: aetheros-substrate services: substrate: build: context: . dockerfile: Dockerfile container_name: aether-substrate init: true ports: # Host-only bindings for local dev / CLI health checks. # Remote access goes through a tunnel — see docs/networking.md. - "127.0.0.1:3100:3100" # Substrate API - "127.0.0.1:2580:2480" # TAP WebSocket/HTTP networks: - internal - default volumes: - substrate-data:/data - /var/run/docker.sock:/var/run/docker.sock # Shared with the on-demand workspace container (source of truth for writes); # substrate only reads and fs.watches from this side. - workspace-data:/workspace:ro # Docker-in-Docker requires root to access the Docker socket on macOS. # The container is already sandboxed by Docker — root inside != root on host. user: root group_add: - "${DOCKER_GID:-999}" security_opt: - no-new-privileges:true logging: driver: json-file options: max-size: "10m" max-file: "5" environment: - NODE_ENV=production - PORT=3100 # SUBSTRATE_API_KEY has no default — the container will exit if not set. # Generate one with: openssl rand -hex 32 - SUBSTRATE_API_KEY=${SUBSTRATE_API_KEY:?SUBSTRATE_API_KEY is required — set it in your .env file} - TAP_DATABASE_URL=sqlite:///data/tap.db - TAP_BIND=:2480 - TAP_RELAY_URL=https://relay1.us-east.bsky.network - TAP_DISABLE_ACKS=true - TAP_LOG_LEVEL=info - TAP_FULL_NETWORK=false - TAP_COLLECTION_FILTERS=computer.aetheros.*,app.bsky.* - SUBSTRATE_ENABLE_CONTAINERS=${SUBSTRATE_ENABLE_CONTAINERS:-false} - SUBSTRATE_MAX_CONTAINERS=${SUBSTRATE_MAX_CONTAINERS:-5} - SUBSTRATE_CONTAINER_MAX_CPU=${SUBSTRATE_CONTAINER_MAX_CPU:-1.0} - SUBSTRATE_CONTAINER_MAX_MEMORY_MB=${SUBSTRATE_CONTAINER_MAX_MEMORY_MB:-512} - SUBSTRATE_CONTAINER_IMAGE_ALLOWLIST=${SUBSTRATE_CONTAINER_IMAGE_ALLOWLIST:-} - SUBSTRATE_ALLOWED_ORIGINS=${SUBSTRATE_ALLOWED_ORIGINS:-} - SUBSTRATE_ENABLE_WORKSPACE=${SUBSTRATE_ENABLE_WORKSPACE:-false} - SUBSTRATE_WORKSPACE_IMAGE=${SUBSTRATE_WORKSPACE_IMAGE:-node:22-alpine} - SUBSTRATE_ENABLE_TERMINAL_WS=${SUBSTRATE_ENABLE_TERMINAL_WS:-false} - SUBSTRATE_ENABLE_EMBEDDINGS=${SUBSTRATE_ENABLE_EMBEDDINGS:-true} - EMBEDDINGS_MODEL_ID=${EMBEDDINGS_MODEL_ID:-onnx-community/embeddinggemma-300m-ONNX} - EMBEDDINGS_DTYPE=${EMBEDDINGS_DTYPE:-q4} - EMBEDDINGS_DIMENSIONS=${EMBEDDINGS_DIMENSIONS:-768} - EMBEDDING_SERVER_PORT=${EMBEDDING_SERVER_PORT:-3101} - SUBSTRATE_ENABLE_LLM=${SUBSTRATE_ENABLE_LLM:-true} - SUBSTRATE_TRUST_PROXY=${SUBSTRATE_TRUST_PROXY:-true} - LLM_DEFAULT_PROVIDER=${LLM_DEFAULT_PROVIDER:-} - LLM_DEFAULT_MODEL=${LLM_DEFAULT_MODEL:-} - LLM_DEFAULT_BASE_URL=${LLM_DEFAULT_BASE_URL:-} - LLM_API_KEY=${LLM_API_KEY:-} restart: unless-stopped deploy: resources: limits: cpus: "4.0" memory: 4G reservations: cpus: "0.5" memory: 512M healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3100/ready"] interval: 30s timeout: 10s retries: 3 start_period: 120s caddy: image: caddy:2-alpine container_name: aether-caddy init: true ports: - "127.0.0.1:${SUBSTRATE_HTTPS_PORT:-8443}:${SUBSTRATE_HTTPS_PORT:-8443}" networks: - internal - default volumes: - ./Caddyfile:/etc/caddy/Caddyfile:ro - caddy-data:/data - caddy-config:/config environment: - SUBSTRATE_HOST=${SUBSTRATE_HOST:-localhost} - SUBSTRATE_HTTPS_PORT=${SUBSTRATE_HTTPS_PORT:-8443} depends_on: substrate: condition: service_healthy restart: unless-stopped security_opt: - no-new-privileges:true logging: driver: json-file options: max-size: "10m" max-file: "5" volumes: substrate-data: driver: local # Shared with the on-demand workspace container created by ContainerManager. # `name:` pins the literal volume name (bypasses compose project prefix) so # both the compose-managed substrate and the Docker-Engine-API-managed # workspace container see the same volume. workspace-data: name: aetheros-workspace-data driver: local caddy-data: driver: local caddy-config: driver: local networks: # Internal network: substrate ↔ caddy traffic stays off the host network stack. internal: driver: bridge internal: true # Default bridge: exposes the 127.0.0.1-bound host ports defined above. default: driver: bridge