-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
171 lines (161 loc) · 4.13 KB
/
docker-compose.yml
File metadata and controls
171 lines (161 loc) · 4.13 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: fever-oracle-backend
ports:
- "5000:5000"
environment:
- FLASK_ENV=development
- PORT=5000
- KAFKA_BOOTSTRAP_SERVERS=kafka:9093
- ALLOWED_ORIGINS=http://localhost:8080,http://localhost:7000,http://localhost:8081
volumes:
- ./backend:/app
- ./data:/app/data
depends_on:
db:
condition: service_started
kafka:
condition: service_started # Backend can start without Kafka (uses mock mode)
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- fever-oracle-network
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.5'
memory: 512M
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: fever-oracle-frontend
ports:
- "8080:8080"
environment:
- VITE_API_URL=http://localhost:5000
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
networks:
- fever-oracle-network
db:
image: postgres:15-alpine
container_name: fever-oracle-db
environment:
- POSTGRES_DB=fever_oracle
- POSTGRES_USER=fever_user
- POSTGRES_PASSWORD=fever_password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- fever-oracle-network
zookeeper:
image: confluentinc/cp-zookeeper:7.5.0
container_name: fever-oracle-zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- "2181:2181"
networks:
- fever-oracle-network
restart: unless-stopped
kafka:
image: confluentinc/cp-kafka:7.5.0
container_name: fever-oracle-kafka
depends_on:
zookeeper:
condition: service_started
ports:
- "9092:9092"
- "9093:9093"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,PLAINTEXT_INTERNAL://kafka:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT_INTERNAL
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
networks:
- fever-oracle-network
restart: unless-stopped
kafka-producer:
build:
context: ./scripts
dockerfile: Dockerfile.kafka
container_name: fever-oracle-kafka-producer
depends_on:
kafka:
condition: service_started
backend:
condition: service_started
environment:
- KAFKA_BOOTSTRAP_SERVERS=kafka:9093
- DATA_DIR=/app/data
volumes:
- ./data:/app/data
- ./scripts:/app
networks:
- fever-oracle-network
command: python -u kafka_data_producer.py --topic all --bootstrap-servers kafka:9093 --interval 30
restart: unless-stopped
admin-portal:
build:
context: ./admin-portal
dockerfile: Dockerfile
container_name: fever-oracle-admin-portal
ports:
- "7000:7000"
environment:
- VITE_API_URL=http://localhost:5000
volumes:
- ./admin-portal:/app
- /app/node_modules
depends_on:
backend:
condition: service_started
restart: unless-stopped
networks:
- fever-oracle-network
patient-portal:
build:
context: ./patient-portal
dockerfile: Dockerfile
container_name: fever-oracle-patient-portal
ports:
- "8081:8081"
environment:
- VITE_API_URL=http://localhost:5000
volumes:
- ./patient-portal:/app
- /app/node_modules
depends_on:
backend:
condition: service_started
restart: unless-stopped
networks:
- fever-oracle-network
networks:
fever-oracle-network:
driver: bridge
volumes:
postgres_data: