-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.dev.yml
136 lines (125 loc) · 3.08 KB
/
docker-compose.dev.yml
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
services:
dev-postgres:
image: postgres:14
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
volumes:
- dev_postgres_data:/var/lib/postgresql/data
- ./scripts/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
networks:
- app-network
restart: always
dev-migrate-database:
build:
context: .
dockerfile: ./database/Dockerfile
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_HOST: dev-postgres
HISTORICAL_DATABASE_URL: postgres://postgres:password@dev-postgres:5432/market_data
TRADING_DATABASE_URL: postgres://postgres:password@dev-postgres:5432/trading_data
depends_on:
- dev-postgres # Ensure PostgreSQL is ready first
command: >
sh -c "
/app/scripts/migrate-db.sh historical &&
/app/scripts/migrate-db.sh trading
"
networks:
- app-network
# Historical service
dev-historical-service:
build:
context: .
dockerfile: "./historical/Dockerfile"
environment:
HISTORICAL_DATABASE_URL: postgres://postgres:password@dev-postgres:5432/market_data
HISTORICAL_PORT: "8080"
LOG_FILE: /app/logs/historical.log
LOG_LEVEL: info
depends_on:
- dev-migrate-database
ports:
- "8080:8080"
volumes:
- data:/app/data
- logs:/app/logs
- scripts:/app/scripts
command: ["./midas-historical"]
networks:
- app-network
restart: always
# Trading service
dev-trading-service:
build:
context: .
dockerfile: "./trading/Dockerfile"
environment:
TRADING_DATABASE_URL: postgres://postgres:password@dev-postgres:5432/trading_data
TRADING_PORT: "8081"
LOG_FILE: /app/logs/trading.log
LOG_LEVEL: info
depends_on:
- dev-migrate-database
ports:
- "8081:8081"
volumes:
- data:/app/data
- logs:/app/logs
- scripts:/app/scripts
command: ["./midas-trading"]
networks:
- app-network
restart: always
# Instrument service
dev-instrument-service:
build:
context: .
dockerfile: "./instrument/Dockerfile"
environment:
INSTRUMENT_DATABASE_URL: postgres://postgres:password@dev-postgres:5432/market_data
INSTRUMENT_PORT: "8082"
LOG_FILE: /app/logs/instrument.log
LOG_LEVEL: info
depends_on:
- dev-migrate-database
ports:
- "8082:8082"
volumes:
- data:/app/data
- logs:/app/logs
- scripts:/app/scripts
command: ["./midas-instrument"]
networks:
- app-network
restart: always
networks:
app-network:
driver: bridge
volumes:
logs:
driver: local
driver_opts:
o: bind
type: none
device: ./logs
data:
driver: local
driver_opts:
o: bind
type: none
device: ./data
scripts:
driver: local
driver_opts:
o: bind
type: none
device: ./scripts
dev_postgres_data:
driver: local
driver_opts:
o: bind
type: none
device: ./postgres/data