-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yaml
126 lines (117 loc) · 3.14 KB
/
docker-compose.yaml
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
117
118
119
120
121
122
123
124
125
126
version: '3.4'
services:
hangman-projections:
container_name: hangman-projections
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${PROJECTIONS_CREDENTIALS_PASSWORD}
MYSQL_DATABASE: ${PROJECTIONS_DATABASE}
MYSQL_TCP_PORT: ${PROJECTIONS_PORT}
networks:
- backend
ports:
- ${PROJECTIONS_PORT}:${PROJECTIONS_PORT}
volumes:
- type: volume
source: projections-volume-data
target: /var/lib/projections
hangman-eventstore:
container_name: hangman-eventstore
image: eventstore/eventstore:20.6.1-buster-slim
env_file:
- ./.env
ports:
- '${EVENTSTORE_EXT_TCP_PORT}:1113'
- '${EVENTSTORE_EXT_HTTP_PORT}:2113'
volumes:
- type: volume
source: eventstore-volume-data
target: /var/lib/eventstore
- type: volume
source: eventstore-volume-logs
target: /var/log/eventstore
networks:
- backend
hangman-position:
container_name: hangman-position
image: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: '${STORE_STATE_USERNAME}'
MONGO_INITDB_ROOT_PASSWORD: '${STORE_STATE_PASSWORD}'
ports:
- ${STORE_STATE_PORT}:${STORE_STATE_PORT}
networks:
- backend
mongo-express:
container_name: mongo-express
image: mongo-express
restart: always
ports:
- 8091:8091
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: '${STORE_STATE_USERNAME}'
ME_CONFIG_MONGODB_ADMINPASSWORD: '${STORE_STATE_PASSWORD}'
ME_CONFIG_MONGODB_URL: mongodb://${STORE_STATE_USERNAME}:${STORE_STATE_PASSWORD}@hangman-position:${STORE_STATE_PORT}/
networks:
- backend
redis:
container_name: redis
image: "redis:alpine"
ports:
- ${REDIS_PORT}:${REDIS_PORT}
networks:
- backend
redis-commander:
container_name: redis-commander
hostname: redis-commander
image: ghcr.io/joeferner/redis-commander:latest
restart: always
environment:
- REDIS_HOSTS=local:redis:6379
ports:
- "8081:8081"
depends_on:
- redis
networks:
- backend
hangman:
container_name: hangman
build:
context: '.'
env_file:
- ./.env
command: ${CONTAINER_COMMAND}
restart: always
deploy:
mode: replicated
replicas: ${CONTAINER_SCALE}
# above is ignored by dc up and dc run (only when deploy to swarm with docker stack deploy)
depends_on:
- hangman-projections
- hangman-eventstore
# service wont be started before this service is running
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:7070']
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
ports:
- '${APP_PORT}:${CONTAINER_PORT}'
volumes:
- './src:/app/src'
links:
- hangman-projections
# by default, any service can reach any other service at that service’s name.
networks:
- backend
volumes:
projections-volume-data:
eventstore-volume-data:
eventstore-volume-logs:
networks:
backend:
driver: bridge