-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (64 loc) · 1.6 KB
/
docker-compose.yml
File metadata and controls
71 lines (64 loc) · 1.6 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
version: '3.9'
services:
consul-server:
image: hashicorp/consul:1.15.2
container_name: consul-server
restart: always
volumes:
- ./consul/server.json:/consul/config/server.json:ro
- ./consul/kv-store:/consul/config/kv-store
- consul:/consul/data
networks:
- consul-demo
ports:
- "8501:8500"
command: "agent"
consul-client:
image: hashicorp/consul:1.15.2
container_name: consul-client
restart: always
volumes:
- ./consul/client.json:/consul/config/client.json:ro
networks:
- consul-demo
command: "agent"
gateway:
image: kirillesau/spring-gateway-showcase
depends_on:
- consul-server
ports:
- "8888:8080"
environment:
- SPRING_CLOUD_CONSUL_HOST=consul-server
networks:
- consul-demo
spring-demo-application:
image: kirillesau/spring-demo-application
depends_on:
- consul-client
- consul-server
- spring-demo-db
deploy:
replicas: 3
environment:
- spring.cloud.consul.host=consul-server
- spring.datasource.url=jdbc:postgresql://spring-demo-db:5432/postgres
- spring.datasource.driver-class-name=org.postgresql.Driver
- spring.datasource.username=postgres
- spring.datasource.password=mypw123
- spring.jpa.hibernate.ddl-auto=update
- spring.sql.init.mode=always
networks:
- consul-demo
- spring-demo
spring-demo-db:
image: postgres:latest
environment:
- POSTGRES_PASSWORD=mypw123
networks:
- spring-demo
networks:
consul-demo:
spring-demo:
volumes:
consul: