-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.full.yml
More file actions
117 lines (109 loc) · 2.73 KB
/
docker-compose.full.yml
File metadata and controls
117 lines (109 loc) · 2.73 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
version: "3.9"
x-logging: &default-logging
driver: json-file
options:
max-size: "10m"
max-file: "3"
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: mock
POSTGRES_PASSWORD: mock
POSTGRES_DB: mockstack
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mock -d mockstack"]
interval: 5s
timeout: 5s
retries: 20
logging: *default-logging
redis:
image: redis:7-alpine
command: redis-server --maxmemory 128mb --maxmemory-policy allkeys-lru
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
logging: *default-logging
ai-service:
build:
context: ./ai-service
env_file:
- ./ai-service/.env
environment:
- ENV=dev
- GRPC_HOST=0.0.0.0
- GRPC_PORT=50051
ports:
- "50051:50051"
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "python -c \"import grpc; ch = grpc.insecure_channel('localhost:50051'); grpc.channel_ready_future(ch).result(timeout=5)\""]
interval: 15s
timeout: 10s
retries: 5
start_period: 10s
logging: *default-logging
chat-service:
build:
context: ./chat-service
env_file:
- ./chat-service/.env
environment:
- DATABASE_URL=postgresql+asyncpg://mock:mock@postgres:5432/mockstack
- REDIS_URL=redis://redis:6379/0
- AI_GRPC_TARGET=ai-service:50051
- ENV=dev
- CORS_ORIGINS=http://localhost:4200,http://127.0.0.1:4200
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
ai-service:
condition: service_started
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://localhost:8000/health')\""]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
logging: *default-logging
workers:
build:
context: ./workers
env_file:
- ./workers/.env
environment:
- DATABASE_URL=postgresql+asyncpg://mock:mock@postgres:5432/mockstack
- REDIS_URL=redis://redis:6379/0
- ENV=dev
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
logging: *default-logging
frontend:
build:
context: ./frontend
ports:
- "4200:80"
depends_on:
chat-service:
condition: service_healthy
restart: unless-stopped
logging: *default-logging
volumes:
postgres_data: