-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
80 lines (80 loc) · 1.74 KB
/
docker-compose.yml
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
version: '2'
services:
moviechallenge:
build:
context: ./
dockerfile: ./Dockerfile
image: fza/moviechallenge
ports:
- "8080:8080"
environment:
- CONSUL_HOST=consul-local
- CONSUL_PORT=8500
- VAULT_HOST=vault-local
- VAULT_SCHEME=http
- VAULT_SECURITY_TOKEN=myroot
- VAULT_PORT=8200
- ADDITIONAL_OPTS= -Dspring.profiles.active=local
- MONGODB_URI=mongo-local:27017
- MONGODB_DATABASE=movies
- MONGODB_AUTH_DATABASE=admin
links:
- consul-local
- vault-local
- mongo-local
depends_on:
- consul-local
- vault-local
- mongo-local
consul-local:
image: consul:1.1.0
ports:
- 8500:8500
consul-cli:
image: consul:1.1.0
ports:
- "8500"
environment:
- CONSUL_HTTP_ADDR=http://consul-local:8500
volumes:
- "./data/consul:/tmp/consul-seed"
command: consul kv import @/tmp/consul-seed/data.json
links:
- consul-local
depends_on:
- consul-local
vault-local:
image: vault:0.8.3
ports:
- 8200:8200
environment:
- VAULT_DEV_ROOT_TOKEN_ID=myroot
cap_add:
- IPC_LOCK
vault-cli:
image: vault:0.8.3
cap_add:
- IPC_LOCK
environment:
- VAULT_TOKEN=myroot
- VAULT_ADDR=http://vault-local:8200
command: vault write secret/moviechallenge mongodb.username=movies mongodb.password=movies
depends_on:
- vault-local
links:
- vault-local
mongo-local:
image: mongo:latest
ports:
- 27017:27017
environment:
- MONGO_INITDB_ROOT_USERNAME=movies
- MONGO_INITDB_ROOT_PASSWORD=movies
- MONGODB_DATABASE=movies
networks:
default:
driver: bridge
ipam:
config:
- subnet: 172.21.10.0/24
gateway: 172.21.10.1