diff --git a/.gitignore b/.gitignore index 809e0e509..9973c00e2 100644 --- a/.gitignore +++ b/.gitignore @@ -291,6 +291,7 @@ wheels/ # === DOCKER === .dockerignore Dockerfile.* +docker-compose.override.yml # === MISC === .Python diff --git a/docker-compose.override.example.yml b/docker-compose.override.example.yml new file mode 100644 index 000000000..8423e5bcf --- /dev/null +++ b/docker-compose.override.example.yml @@ -0,0 +1,84 @@ +# AutoBot Docker Compose — Development Override (#1911) +# Activated automatically when copied to docker-compose.override.yml. +# Provides: live code reloading, debug ports, relaxed health checks. +# +# Usage: +# cp docker-compose.override.example.yml docker-compose.override.yml +# docker compose up -d # Automatically uses the override +# docker compose -f docker-compose.yml up -d # Skip override (production) +# +# Known limitations: +# - autobot-shared changes require container restart (pip -e install at boot) +# - Frontend: run `npm run build` on host; dist/ is served by nginx (no HMR) +# - On WSL2 (core.symlinks=false): symlinks are recreated at container start +# - env_file from base compose is still active; these vars override it +# +# AutoBot - AI-Powered Automation Platform +# Copyright (c) 2025 mrveiss +# Author: mrveiss + +services: + autobot-backend: + volumes: + - ./autobot-backend:/app/autobot-backend + - ./autobot-shared:/app/autobot-shared + command: > + bash -c " + ln -sf /app/autobot-shared /app/autobot_shared && + ln -sf /app/autobot-shared /app/autobot-backend/autobot_shared && + pip install -e /app/autobot-shared --quiet && + python3.12 -m uvicorn main:app + --host 0.0.0.0 --port 8000 + --reload + --reload-dir /app/autobot-backend + --reload-dir /app/autobot-shared + --app-dir /app/autobot-backend + " + environment: + - AUTOBOT_ENVIRONMENT=development + - AUTOBOT_LOG_LEVEL=DEBUG + ports: + # debugpy remote debugging — to enable, install debugpy in container: + # docker exec -it autobot-backend pip install debugpy + # then restart with: python -m debugpy --listen 0.0.0.0:5678 -m uvicorn ... + - "5678:5678" + healthcheck: + interval: 30s + timeout: 15s + retries: 10 + start_period: 180s + deploy: + resources: + limits: + memory: 4G + cpus: '4.0' + + autobot-slm: + volumes: + - ./autobot-slm-backend:/app/autobot-slm-backend + - ./autobot-shared:/app/autobot-shared + command: > + bash -c " + ln -sf /app/autobot-shared /app/autobot_shared && + pip install -e /app/autobot-shared --quiet && + python3.12 -m uvicorn main:app + --host 0.0.0.0 --port 8000 + --reload + --reload-dir /app/autobot-slm-backend + --reload-dir /app/autobot-shared + --app-dir /app/autobot-slm-backend + " + environment: + - AUTOBOT_ENVIRONMENT=development + - AUTOBOT_LOG_LEVEL=DEBUG + healthcheck: + interval: 30s + timeout: 15s + retries: 10 + start_period: 60s + + # Frontend: mount pre-built dist/ into nginx. + # Run `npm run build` on host after changes — no HMR in this mode. + autobot-frontend: + volumes: + - ./autobot-frontend/dist:/usr/share/nginx/html