-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
95 lines (89 loc) · 2.64 KB
/
docker-compose.yml
File metadata and controls
95 lines (89 loc) · 2.64 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
services:
# Service Registry (Eureka Server) - Start first
service-registry:
image: public.ecr.aws/k2g9v6r8/spring-microservice/shop-service-registry:latest
container_name: service-registry
ports:
- "8761:8761"
environment:
- SPRING_PROFILES_ACTIVE=docker
- JAVA_OPTS=-Xmx512m -Xms256m
networks:
- microservices-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8761/api/v1/service/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# API Gateway - Start after service registry
api-gateway:
image: public.ecr.aws/k2g9v6r8/spring-microservice/shop-api-gateway:latest
container_name: api-gateway
ports:
- "8080:8080"
environment:
- SPRING_PROFILES_ACTIVE=docker
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://service-registry:8761/eureka/
- JAVA_OPTS=-Xmx512m -Xms256m
networks:
- microservices-network
restart: unless-stopped
depends_on:
service-registry:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Auth Service
auth-service:
image: public.ecr.aws/k2g9v6r8/spring-microservice/shop-auth:latest
container_name: auth-service
ports:
- "8082:8082"
environment:
- SPRING_PROFILES_ACTIVE=docker
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://service-registry:8761/eureka/
- JAVA_OPTS=-Xmx512m -Xms256m
networks:
- microservices-network
restart: unless-stopped
depends_on:
service-registry:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8082/api/v1/auth/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# Users Service
users-service:
image: public.ecr.aws/k2g9v6r8/spring-microservice/shop-users:latest
container_name: users-service
ports:
- "8083:8083"
environment:
- SPRING_PROFILES_ACTIVE=docker
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://service-registry:8761/eureka/
- JAVA_OPTS=-Xmx512m -Xms256m
networks:
- microservices-network
restart: unless-stopped
depends_on:
service-registry:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8083/api/v1/users/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
microservices-network:
driver: bridge
# No volumes needed since we removed MySQL