-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
157 lines (149 loc) · 4.21 KB
/
docker-compose.yml
File metadata and controls
157 lines (149 loc) · 4.21 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
version: '3.8'
services:
# Legacy fallback only.
# Preferred local developer flow is Atlas local via:
# atlas deployments setup awm-local --type LOCAL --force
mongodb:
image: mongo:7.0
container_name: agent-legacy-mongodb
restart: unless-stopped
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: password123
MONGO_INITDB_DATABASE: ai_agent_boilerplate
volumes:
- mongodb_data:/data/db
- ./infrastructure/mongodb/init.js:/docker-entrypoint-initdb.d/init.js:ro
networks:
- agent-network
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
profiles:
- legacy_mongo
# Redis for caching
redis:
image: redis:7-alpine
container_name: agent-redis
restart: unless-stopped
ports:
- "6379:6379"
command: redis-server --appendonly yes
volumes:
- redis_data:/data
networks:
- agent-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# Main API service
api:
build:
context: .
dockerfile: Dockerfile
container_name: agent-api
restart: unless-stopped
ports:
- "8000:8000"
env_file:
- .env
environment:
- MONGODB_URI=${MONGODB_URI:-mongodb://admin:password123@host.docker.internal:27017/awm_local_validation?authSource=admin}
- MONGODB_VALIDATION_LANE=${MONGODB_VALIDATION_LANE:-developer_quickstart}
- MONGODB_DEVELOPER_QUICKSTART_DB_NAME=${MONGODB_DEVELOPER_QUICKSTART_DB_NAME:-awm_quickstart}
- MONGODB_LOCAL_VALIDATION_DB_NAME=${MONGODB_LOCAL_VALIDATION_DB_NAME:-awm_local_validation}
- MONGODB_CLOUD_VALIDATION_DB_NAME=${MONGODB_CLOUD_VALIDATION_DB_NAME:-awm_cloud_validation}
- REDIS_URL=redis://redis:6379/0
- API_HOST=0.0.0.0
- API_PORT=8000
- API_WORKERS=4
- LOG_LEVEL=INFO
depends_on:
redis:
condition: service_healthy
networks:
- agent-network
volumes:
- ./logs:/app/logs
- ./data:/app/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health/ready"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Prometheus for metrics
prometheus:
image: prom/prometheus:latest
container_name: agent-prometheus
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- ./infrastructure/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
networks:
- agent-network
depends_on:
- api
# Grafana for visualization
grafana:
image: grafana/grafana:latest
container_name: agent-grafana
restart: unless-stopped
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_INSTALL_PLUGINS=
volumes:
- grafana_data:/var/lib/grafana
- ./infrastructure/monitoring/grafana/dashboards:/etc/grafana/provisioning/dashboards:ro
- ./infrastructure/monitoring/grafana/datasources:/etc/grafana/provisioning/datasources:ro
networks:
- agent-network
depends_on:
- prometheus
# Nginx reverse proxy (optional, for production)
nginx:
image: nginx:alpine
container_name: agent-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./infrastructure/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./infrastructure/nginx/sites-enabled:/etc/nginx/sites-enabled:ro
- ./infrastructure/nginx/ssl:/etc/nginx/ssl:ro
networks:
- agent-network
depends_on:
- api
profiles:
- production
networks:
agent-network:
driver: bridge
name: agent-network
volumes:
mongodb_data:
driver: local
redis_data:
driver: local
prometheus_data:
driver: local
grafana_data:
driver: local