-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
108 lines (100 loc) · 2.54 KB
/
Copy pathdocker-compose.yml
File metadata and controls
108 lines (100 loc) · 2.54 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
version: "3.9"
services:
service-registry:
container_name: service-registry
build:
context: service_registry/
dockerfile: Dockerfile
image: service-registry
networks:
- spring-cloud-network
ports:
- 8761:8761
healthcheck:
test: curl --fail -s http://localhost:8761/ || exit 1
interval: 30s
timeout: 10s
retries: 10
start_period: 10s
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: 'productsdb'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'root'
ports:
- '3306:3306'
expose:
- '3306'
volumes:
- my-db:/var/lib/mysql
networks:
- spring-cloud-network
microservice1:
build:
context: shoppingApp/
dockerfile: Dockerfile
command: bash -c "python shoppingApp/manage.py makemigrations && python shoppingApp/manage.py migrate && python shoppingApp/manage.py createsuperuser && python shoppingApp/manage.py runserver 0.0.0.0:8000"
volumes:
- .:/ProductCatCode
ports:
- "8000:8000"
networks:
- spring-cloud-network
depends_on:
- db
sidecar-product-catalog:
container_name: sidecar-product-catalog
build:
context: sidecar/
dockerfile: Dockerfile
image: sidecar-product-catalog
environment:
- "EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://service-registry:8761/eureka"
- "SPRING_PROFILES_ACTIVE=eureka"
- "SIDECAR_HEALTHURI=http://microservice1:8000/health.json"
- "SIDECAR_HOSTNAME=microservice1"
ports:
- 5678:5678
networks:
- spring-cloud-network
depends_on:
service-registry:
condition: service_healthy
api-gw:
container_name: api-gw
build:
context: apigw/
dockerfile: Dockerfile
image: api-gw
environment:
- "EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://service-registry:8761/eureka"
- "SPRING_PROFILES_ACTIVE=eureka"
ports:
- 8080:8080
networks:
- spring-cloud-network
depends_on:
service-registry:
condition: service_healthy
fe:
container_name: fe
build:
context: shopping_app_fe/
dockerfile: Dockerfile
volumes:
- '.:/shopping_app_fe/app'
- '/shopping_app_fe/app/node_modules'
ports:
- 3001:3000
environment:
- CHOKIDAR_USEPOLLING=true
networks:
- spring-cloud-network
volumes:
my-db:
networks:
spring-cloud-network:
driver: bridge