-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
140 lines (130 loc) · 3.07 KB
/
docker-compose.yml
File metadata and controls
140 lines (130 loc) · 3.07 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
services:
db:
image: postgres:14-alpine
env_file:
- ./.env
environment:
- POSTGRES_DB=${DATABASE_NAME}
- POSTGRES_USER=${DATABASE_USER}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data/
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER} -d ${DATABASE_NAME}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ai_platform_network
migrate:
build:
context: .
dockerfile: Dockerfile.backend
command: >
sh -c "python manage.py migrate --noinput && python manage.py seed_agents"
env_file:
- ./.env
depends_on:
db:
condition: service_healthy
networks:
- ai_platform_network
redis:
image: redis:6.2-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ai_platform_network
minio:
image: minio/minio:latest
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data:/data
env_file:
- ./.env
command: server /data --console-address ":9001"
networks:
- ai_platform_network
elasticsearch:
image: elasticsearch:8.11.1
ports:
- "9200:9200"
environment:
- discovery.type=single-node
- xpack.security.enabled=false
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ai_platform_network
mailhog:
image: mailhog/mailhog
ports:
- "1025:1025" # SMTP
- "8025:8025" # Web UI
networks:
- ai_platform_network
backend:
build:
context: .
dockerfile: Dockerfile.backend
command: >
sh -c "python manage.py collectstatic --noinput && python manage.py index_documents data && gunicorn --bind 0.0.0.0:8000 ai_agent.backend_core.asgi:application -k uvicorn.workers.UvicornWorker --workers 4"
depends_on:
migrate:
condition: service_completed_successfully
mailhog:
condition: service_started
elasticsearch:
condition: service_healthy
env_file:
- ./.env
ports:
- "8000:8000"
volumes:
- ./ai_agent:/app/ai_agent
- ./ai_agent/data:/app/ai_agent/data
networks:
- ai_platform_network
celery:
build:
context: .
dockerfile: Dockerfile.backend
command: celery -A ai_agent.backend_core worker -l info
depends_on:
migrate:
condition: service_completed_successfully
env_file:
- ./.env
networks:
- ai_platform_network
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
ports:
- "3000:80"
depends_on:
- backend
networks:
- ai_platform_network
networks:
ai_platform_network:
driver: bridge
volumes:
postgres_data:
minio_data:
elasticsearch_data: