-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
112 lines (103 loc) · 2.2 KB
/
docker-compose.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
version: "3.8"
services:
redis:
image: redis:6
container_name: redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- app-network
postgres-db:
image: postgres:13
container_name: postgres-db
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "5432:5432"
volumes:
- stock-exchange2:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- app-network
api:
build:
context: ./api
ports:
- "3000:3000"
depends_on:
postgres-db:
condition: service_healthy
redis:
condition: service_healthy
environment:
DATABASE_URL: ${DATABASE_URL}
REDIS_URL: ${REDIS_URL}
networks:
- app-network
db:
build:
context: ./db
depends_on:
postgres-db:
condition: service_healthy
redis:
condition: service_healthy
environment:
DATABASE_URL: ${DATABASE_URL}
REDIS_URL: ${REDIS_URL}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_HOST: postgres-db
POSTGRES_PORT: 5432
REDIS_HOST: redis
REDIS_PORT: 6379
networks:
- app-network
engine:
build:
context: ./engine
depends_on:
redis:
condition: service_healthy
environment:
REDIS_URL: ${REDIS_URL}
networks:
- app-network
ws:
build:
context: ./ws
depends_on:
redis:
condition: service_healthy
environment:
REDIS_URL: ${REDIS_URL}
ports:
- "3001:3001"
networks:
- app-network
frontend:
build:
context: ./frontend
ports:
- "3002:3002" # Assuming frontend runs on this port
environment:
REACT_APP_API_URL: ${REACT_APP_API_URL} # Backend API URL for the frontend
networks:
- app-network
volumes:
stock-exchange2:
networks:
app-network:
driver: bridge