forked from simplyi/SpringCloudVideoCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
107 lines (101 loc) · 3.88 KB
/
docker-compose.yml
File metadata and controls
107 lines (101 loc) · 3.88 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
version: '3'
services:
rabbitmq-container:
image: rabbitmq:3-management
ports:
- 5672:5672
- 15672:15672
volumes:
- ./rabbitmq/definitions.json:/etc/rabbitmq/definitions.json:ro
- ./rabbitmq/rabbitmq.config:/etc/rabbitmq/rabbitmq.config:ro
photo-app-cloud-config:
image: photo-app-cloud/config
container_name: photo-app-cloud-config
build:
context: PhotoAppAPIConfigServer
dockerfile: dockerfile
ports:
- 8012:8012
environment:
- ENCRYPT.KEY-STORE.LOCATION=file:///apiEncryptionKey.jks
- SPRING.RABBITMQ.HOST=rabbitmq-container
depends_on:
- rabbitmq-container
photo-app-cloud-discovery:
image: photo-app-cloud/discovery
container_name: photo-app-cloud-discovery
build:
context: PhotoAppDiscoveryService
dockerfile: dockerfile
ports:
- 8010:8010
environment:
- SPRING.CLOUD.CONFIG.URI=http://photo-app-cloud-config:8012
depends_on:
- rabbitmq-container
- photo-app-cloud-config
photo-app-cloud-zuul:
image: photo-app-cloud/zuul
container_name: photo-app-cloud-zuul
build:
context: PhotoAppApiZuulAPIGateway
dockerfile: dockerfile
ports:
- 8011:8011
environment:
- SPRING.CLOUD.CONFIG.URI=http://photo-app-cloud-config:8012
- SPRING.RABBITMQ.HOST=rabbitmq-container
- EUREKA.CLIENT.SERVICEURL.DEFAULTZONE=http://test:test@photo-app-cloud-discovery:8010/eureka
depends_on:
- rabbitmq-container
- photo-app-cloud-config
- photo-app-cloud-discovery
photo-app-cloud-users:
image: photo-app-cloud/users
container_name: photo-app-cloud-users
build:
context: PhotoAppApiUsers
dockerfile: dockerfile
ports:
- 8000:8000
environment:
- SPRING.CLOUD.CONFIG.URI=http://photo-app-cloud-config:8012
- SPRING.RABBITMQ.HOST=rabbitmq-container
- EUREKA.CLIENT.SERVICEURL.DEFAULTZONE=http://test:test@photo-app-cloud-discovery:8010/eureka
- SERVER.PORT=8000
# You can use container as name instead of ip, docker will automatically determine what the right ip:
- GATEWAY.IP=photo-app-cloud-zuul
# Make application resilient to config-server failure and able config-client to retry the connection on startup:
- SPRING.CLOUD.CONFIG.FAIL-FAST=true
- SPRING.CLOUD.CONFIG.RETRY.MAX-ATTEMPTS=20
- SPRING.CLOUD.CONFIG.RETRY.MAX-INTERVAL=2000
- SPRING.CLOUD.CONFIG.RETRY.INITIAL-INTERVAL=2000
- SPRING.ZIPKIN.BASE-URL=http://zipkin:9411
depends_on:
- rabbitmq-container
- photo-app-cloud-config
- photo-app-cloud-discovery
- zipkin
photo-app-cloud-albums:
image: photo-app-cloud/albums
container_name: photo-app-cloud-albums
build:
context: PhotoAppApiAlbums
dockerfile: dockerfile
ports:
- 8001:8001
environment:
- SPRING.RABBITMQ.HOST=rabbitmq-container
- EUREKA.CLIENT.SERVICEURL.DEFAULTZONE=http://test:test@photo-app-cloud-discovery:8010/eureka
- SERVER.PORT=8001
depends_on:
- rabbitmq-container
- photo-app-cloud-discovery
# For reference: https://github.com/openzipkin/zipkin/blob/master/docker/examples/docker-compose-example.yml
zipkin:
image: ghcr.io/openzipkin/zipkin-slim:${TAG:-latest}
container_name: zipkin
ports:
- 9411:9411
# Uncomment to enable debug logging
# command: --logging.level.zipkin2=DEBUG