-
Notifications
You must be signed in to change notification settings - Fork 4
/
compose-prod.yml
116 lines (105 loc) · 2.54 KB
/
compose-prod.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
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
109
110
111
112
113
114
115
116
version: '3.1'
services:
# MONGODB COMPONENTS
mongo:
image: mongo
container_name: mongo_db
restart: always
ports:
- '27017:27017'
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
MONGO_INITDB_DATABASE: lotto-web
volumes:
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
networks:
- lottery-net
mongo-express:
image: mongo-express
container_name: mongo_express
restart: always #restart the container regardless of the exit status
ports:
- '8081:8081' # port mapping: [external : inside docker environment]
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: example
ME_CONFIG_MONGODB_URL: mongodb://root:example@mongo:27017/ # mongodb://{mongo-image-username}:{mongo-image-password}@{mongo-image-name}:{port}
networks:
- lottery-net
# REDIS COMPONENTS
redis:
image: redis
container_name: redis
restart: always
ports:
- '6379:6379'
command: redis-server --save 60 1 --loglevel warning #save every 60 seconds for at least 1 operation
volumes:
- redis:/data
networks:
- lottery-net
redis-commander:
image: rediscommander/redis-commander:latest
container_name: redis-commander
hostname: redis-commander
restart: always
environment:
- REDIS_HOSTS=local:redis:6379
ports:
- "8082:8081"
networks:
- lottery-net
# NGINX REVERSE-PROXY
nginx:
image: nginx:latest
container_name: nginx
restart: always
ports:
- '80:80'
depends_on:
- lottery-engine
- winning-numbers
volumes:
- ./lottery.conf:/etc/nginx/conf.d/lottery.conf
networks:
- lottery-net
# PROJECT MICROSERVICES
eureka-server:
image: pjazdzyk/eureka-server:latest
container_name: eureka-server
restart: always
ports:
- '8761:8761'
networks:
- lottery-net
winning-numbers:
image: pjazdzyk/winning-numbers:latest
depends_on:
- mongo
- eureka-server
container_name: winning-numbers
restart: always
ports:
- '8001:8001'
networks:
- lottery-net
lottery-engine:
image: pjazdzyk/lottery-engine:latest
depends_on:
- mongo
- eureka-server
- redis
- winning-numbers
container_name: lottery-engine
restart: always
ports:
- '8000:8000'
networks:
- lottery-net
volumes:
redis:
driver: local
networks:
lottery-net:
driver: bridge