-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
95 lines (90 loc) · 3.33 KB
/
docker-compose.yml
File metadata and controls
95 lines (90 loc) · 3.33 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
# Docker Compose configuration for MAGI System
services:
# Postgres database service - shared among all projects/containers
db:
image: pgvector/pgvector:pg16
container_name: magi-postgres
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- '5432:5432' # Expose default Postgres port
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- magi-network
# Controller service - the main web interface and container manager
magi-controller:
container_name: magi-controller
build:
context: ./
dockerfile: ./controller/docker/Dockerfile
# Enable BuildKit features
args:
BUILDKIT_INLINE_CACHE: 1
ports:
- '3010:3010' # Expose web interface port
volumes:
- magi_home:/magi_home:rw # For home directory files
- magi_output:/magi_output:rw # For output storage
- custom_tools:/custom_tools:rw # Custom tools
- ../:/external/host:rw # Mount parent directory for repo management
- ./.env:/.env:ro # Mount .env file in parent directory (where server expects it)
- /var/run/docker.sock:/var/run/docker.sock # Allow Docker-in-Docker
env_file:
- ./.env
environment:
- PORT=3010
- HOST_HOSTNAME=magi-controller # Use service name for internal communication
- NODE_ENV=development # Set environment to development
- TZ=$(date +%Z) # Get host timezone - conversion handled in code
- UV_USE_IO_URING=0 # Fix for Node.js io_uring bug causing PTY disconnects
- MAGI_INITIAL_COMMAND=${MAGI_INITIAL_COMMAND:-} # Pass initial command if provided
networks:
- magi-network
stop_signal: SIGINT
stop_grace_period: 15s
restart: unless-stopped
# Base service configuration for magi containers
magi-engine:
image: magi-engine:latest
build:
context: ./
dockerfile: ./engine/docker/Dockerfile
# Enable BuildKit features
args:
BUILDKIT_INLINE_CACHE: 1
volumes:
- ./engine/src:/app/src:rw # Mount source code for development hot reloading
- magi_home:/magi_home:rw
- magi_output:/magi_output:rw
- custom_tools:/custom_tools:rw
env_file:
- ./.env
environment:
- HOST_HOSTNAME=magi-controller # Use service name instead of host.docker.internal
- CONTROLLER_PORT=3010
- TZ=$(date +%Z) # Get host timezone - conversion handled in code
- UV_USE_IO_URING=0 # Fix for Node.js io_uring bug causing PTY disconnects
networks:
- magi-network
# restart: unless-stopped
profiles:
- 'donotstart' # Prevents this service from starting automatically
networks:
magi-network:
driver: bridge
volumes:
magi_home:
name: magi_home
external: true
magi_output:
name: magi_output
external: true
custom_tools:
name: custom_tools
external: true
postgres_data:
name: postgres_data