forked from trevortrinh/exchange
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
119 lines (113 loc) · 2.58 KB
/
docker-compose.yaml
File metadata and controls
119 lines (113 loc) · 2.58 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
services:
# PostgreSQL
postgres:
image: postgres:17
container_name: exchange-postgres
environment:
POSTGRES_DB: exchange
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
- exchange-network
restart: unless-stopped
# ClickHouse
clickhouse:
image: clickhouse/clickhouse-server:latest
container_name: exchange-clickhouse
environment:
CLICKHOUSE_DB: exchange
CLICKHOUSE_USER: default
CLICKHOUSE_PASSWORD: password
ports:
- "8123:8123" # HTTP
- "9000:9000" # Native
volumes:
- clickhouse_data:/var/lib/clickhouse
healthcheck:
test: ["CMD", "clickhouse-client", "--query", "SELECT 1"]
interval: 10s
timeout: 5s
retries: 5
networks:
- exchange-network
restart: unless-stopped
# Backend
backend:
build:
context: .
dockerfile: apps/backend/Dockerfile
container_name: exchange-backend
environment:
HOST: 0.0.0.0
PORT: 8888
PG_URL: postgresql://postgres:password@postgres:5432/exchange
CH_URL: http://clickhouse:8123
CH_USER: default
CH_PASSWORD: password
env_file:
- path: ./apps/backend/.env.defaults
required: false
- path: .env
required: false
ports:
- "8888:8888"
depends_on:
postgres:
condition: service_healthy
clickhouse:
condition: service_healthy
networks:
- exchange-network
restart: unless-stopped
# Bots
bots:
build:
context: .
dockerfile: apps/bots/Dockerfile
container_name: exchange-bots
environment:
EXCHANGE_URL: http://backend:8888
env_file:
- path: ./apps/bots/.env.defaults
required: false
- path: .env
required: false
depends_on:
backend:
condition: service_healthy
networks:
- exchange-network
restart: unless-stopped
# Frontend
frontend:
build:
context: .
dockerfile: apps/frontend/Dockerfile
container_name: exchange-frontend
env_file:
- path: ./apps/frontend/.env.example
required: true
- path: .env
required: false
ports:
- "3000:3000"
depends_on:
- backend
networks:
- exchange-network
restart: unless-stopped
volumes:
postgres_data:
clickhouse_data:
networks:
exchange-network:
driver: bridge