-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
174 lines (144 loc) · 5.16 KB
/
docker-compose.yaml
File metadata and controls
174 lines (144 loc) · 5.16 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
services:
# ============================================================================
# MUXI Runtime - Main Service (2.4GB optimized image)
# ============================================================================
# Usage: docker-compose up muxi
# Access: http://localhost:8000
#
# This service runs MUXI formations with all dependencies included.
# Mount your formations directory and set API keys in .env file.
# ============================================================================
muxi:
image: muxi-runtime:latest
container_name: muxi-runtime
restart: unless-stopped
# Override default CMD to run a formation
# Change this to point to your formation:
command: >
python -m muxi.utils.run_formation
/formations/your-formation/formation.afs
ports:
- "${MUXI_PORT:-8000}:8000"
volumes:
# Mount your formations directory (read-write for secrets management)
# Note: MUXI needs write access to create .key files
- ${FORMATIONS_DIR:-./formations}:/formations
# Persistent data directory
- ${DATA_DIR:-./data}:/data
# Logs directory (optional)
- ${LOGS_DIR:-./logs}:/logs
# Optional: Mount secrets.env file if formations need it
# - ./formations/my-formation/secrets.env:/app/secrets.env:ro
environment:
# MUXI Configuration
# Note: API keys come from secrets.enc in formation directories
# Do NOT set them as environment variables
- MUXI_FORMATIONS_DIR=/formations
- MUXI_DATA_DIR=/data
- MUXI_LOGS_DIR=/logs
- PYTHONUNBUFFERED=1
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- muxi-network
# Optional: Resource limits (uncomment to use)
# deploy:
# resources:
# limits:
# cpus: '4.0'
# memory: 8G
# reservations:
# cpus: '2.0'
# memory: 4G
# ============================================================================
# MUXI Production - Full Stack with PostgreSQL (Optional)
# ============================================================================
# Usage: docker-compose up muxi-production postgres
# Access: http://localhost:8001
#
# Includes PostgreSQL with pgvector for production deployments.
# Use this when you need persistent memory and vector search.
# ============================================================================
muxi-production:
image: muxi-runtime:production
container_name: muxi-production
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
ports:
- "${MUXI_PROD_PORT:-8001}:8000"
volumes:
- ${FORMATIONS_DIR:-./formations}:/formations:ro
- ${DATA_DIR:-./data}:/data
- ${LOGS_DIR:-./logs}:/logs
environment:
# Note: LLM API keys come from secrets.enc in formation directories
# Do NOT set them as environment variables
# Database Configuration
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_DB=${POSTGRES_DB:-muxi}
- POSTGRES_USER=${POSTGRES_USER:-muxi}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-muxi_password}
- DATABASE_URL=postgresql://${POSTGRES_USER:-muxi}:${POSTGRES_PASSWORD:-muxi_password}@postgres:5432/${POSTGRES_DB:-muxi}
# MUXI Configuration
- MUXI_FORMATIONS_DIR=/formations
- MUXI_DATA_DIR=/data
- MUXI_LOGS_DIR=/logs
- PYTHONUNBUFFERED=1
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- muxi-network
# ============================================================================
# PostgreSQL with pgvector (For Production Setup)
# ============================================================================
# Only needed when using muxi-production service
# Provides persistent storage and vector similarity search
# ============================================================================
postgres:
image: pgvector/pgvector:pg17
container_name: muxi-postgres
restart: unless-stopped
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d:ro
environment:
- POSTGRES_DB=${POSTGRES_DB:-muxi}
- POSTGRES_USER=${POSTGRES_USER:-muxi}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-muxi_password}
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-muxi}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- muxi-network
# Optional: Performance tuning (uncomment for production)
# command: >
# postgres
# -c shared_buffers=256MB
# -c max_connections=100
# -c work_mem=16MB
# -c maintenance_work_mem=64MB
networks:
muxi-network:
driver: bridge
name: muxi-network
volumes:
postgres-data:
driver: local
name: muxi-postgres-data