-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
110 lines (102 loc) · 2.44 KB
/
Copy pathdocker-compose.yml
File metadata and controls
110 lines (102 loc) · 2.44 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
services:
# Centralized MySQL database container
db:
image: mysql:8.0
container_name: ec-mysql
restart: unless-stopped
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: rootpassword
volumes:
- ./docker/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-prootpassword"]
interval: 10s
timeout: 5s
retries: 5
# Centralized Redis cache/queue container
redis:
image: redis:alpine
container_name: ec-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
# Authentication Service
auth-service:
build:
context: ./auth-service
container_name: auth-service
restart: unless-stopped
volumes:
- ./auth-service:/var/www/html
depends_on:
db:
condition: service_healthy
# Inventory Service
inventory-service:
build:
context: ./inventory-service
container_name: inventory-service
restart: unless-stopped
volumes:
- ./inventory-service:/var/www/html
depends_on:
db:
condition: service_healthy
# Order Service (integrated with Redis)
order-service:
build:
context: ./order-service
container_name: order-service
restart: unless-stopped
volumes:
- ./order-service:/var/www/html
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
# Payment Service
payment-service:
build:
context: ./payment-service
container_name: payment-service
restart: unless-stopped
volumes:
- ./payment-service:/var/www/html
depends_on:
db:
condition: service_healthy
# Shipping Service
shipping-service:
build:
context: ./shipping-service
container_name: shipping-service
restart: unless-stopped
volumes:
- ./shipping-service:/var/www/html
depends_on:
db:
condition: service_healthy
# API Gateway Nginx proxy
gateway:
image: nginx:alpine
container_name: api-gateway
restart: unless-stopped
ports:
- "8000:80"
volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- auth-service
- inventory-service
- order-service
- payment-service
- shipping-service
volumes:
mysql_data:
redis_data: