-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.override.example.yml
More file actions
95 lines (92 loc) · 3.51 KB
/
docker-compose.override.example.yml
File metadata and controls
95 lines (92 loc) · 3.51 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
84
85
86
87
88
89
90
91
92
93
94
95
# AutoBot Docker Compose — Development Override (#1911, #1985)
# 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 at boot)
# - Frontend: run `npm run build` on host; dist/ is served by nginx
# - env_file from base compose is still active; these vars override it
#
# Dev entrypoint (#1985):
# Bind mounts replace directories that the Dockerfile populated with
# symlinks and pip-installed packages. The dev-entrypoint.sh scripts
# run at container start to:
# 1. Recreate symlinks destroyed by bind mounts
# 2. Re-install autobot_shared as editable pip package
# 3. Exec the original command (uvicorn with --reload)
# This fixes ImportError on WSL2 where symlinks cannot be created
# on the host filesystem (core.symlinks=false).
#
# AutoBot - AI-Powered Automation Platform
# Copyright (c) 2025 mrveiss
# Author: mrveiss
services:
autobot-backend:
# Dev entrypoint restores symlinks and pip packages before starting
# the application. See docker/backend/dev-entrypoint.sh for details.
entrypoint: ["/app/docker/backend/dev-entrypoint.sh"]
volumes:
- ./autobot-backend:/app/autobot-backend
- ./autobot_shared:/app/autobot_shared
# Mount the dev entrypoint script into the container
- ./docker/backend/dev-entrypoint.sh:/app/docker/backend/dev-entrypoint.sh
command: >
python3.12 -m uvicorn main:app
--host 0.0.0.0 --port 8001
--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:
# Dev entrypoint restores symlinks, pip packages, and runs migrations
# before starting the application. Replaces the production entrypoint.
entrypoint: ["/app/docker/slm/dev-entrypoint.sh"]
volumes:
- ./autobot-slm-backend:/app/autobot-slm-backend
- ./autobot_shared:/app/autobot_shared
# Mount the dev entrypoint script into the container
- ./docker/slm/dev-entrypoint.sh:/app/docker/slm/dev-entrypoint.sh
command: >
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