-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
181 lines (171 loc) · 4.71 KB
/
docker-compose.yml
File metadata and controls
181 lines (171 loc) · 4.71 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
services:
consul:
image: consul:1.15
container_name: consul
ports:
- "8500:8500"
- "8600:8600"
- "8600:8600/udp"
command: "agent -dev -client 0.0.0.0 -ui"
healthcheck:
test: [ "CMD", "wget", "--spider", "-q", "http://localhost:8500/v1/status/leader" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
environment:
CONSUL_BIND_INTERFACE: eth0
networks:
- code-typing
restart: always
fabio:
image: fabiolb/fabio
container_name: fabio
ports:
- "9999:9999"
- "9998:9998"
environment:
FABIO_REGISTRY_CONSUL_ADDR: "consul:8500"
depends_on:
consul:
condition: service_healthy
networks:
- code-typing
postgres-text-db:
container_name: postgres-text-db-container
image: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: pass
POSTGRES_DB: text_db
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres
- .:/docker-entrypoint-initdb.d
command: postgres -c 'max_connections=1000'
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
interval: 10s
retries: 3
start_period: 5s
networks:
- code-typing
restart: unless-stopped
code-typing-text-service:
container_name: code-typing-text-service-container
image: ghcr.io/ttodoshi/code-typing-text-service:latest
ports:
- "8080:8080"
depends_on:
postgres-text-db:
condition: service_healthy
environment:
SECRET_KEY: "secretsecretsecretsecretsecretsecretsecretsecretsecretsecretsecretsecret"
PORT: 8080
PROFILE: "dev"# dev, prod
LOG_LEVEL: "debug"#trace, debug, info, warn, error
DB_URL: "host=postgres-text-db user=postgres password=pass dbname=text_db port=5432 sslmode=disable"
CONSUL_HOST: "consul:8500"
CONSUL_SERVICE_NAME: "text-service"
CONSUL_SERVICE_ADDRESS: "code-typing-text-service"
CONSUL_TAGS: "urlprefix-/api/v1/texts"
networks:
- code-typing
mongo:
image: mongo
container_name: mongo-container
environment:
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=pass
volumes:
- mongo:/data/db
ports:
- "27017:27017"
depends_on:
rabbitmq:
condition: service_healthy
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
retries: 3
start_period: 5s
networks:
code-typing:
restart: unless-stopped
code-typing-auth-service:
container_name: code-typing-auth-service-container
image: ghcr.io/ttodoshi/code-typing-auth-service:latest
ports:
- "8090:8090"
depends_on:
mongo:
condition: service_healthy
environment:
ACCESS_TOKEN_EXP: 300
REFRESH_TOKEN_EXP: 1209600
COOKIE_HOST: "localhost"
SECRET_KEY: "secretsecretsecretsecretsecretsecretsecretsecretsecretsecretsecretsecret"
PORT: 8090
PROFILE: "dev"# dev, prod
LOG_LEVEL: "debug"#trace, debug, info, warn, error
DB_URL: "mongodb://admin:pass@mongo:27017"
CONSUL_HOST: "consul:8500"
CONSUL_SERVICE_NAME: "auth-service"
CONSUL_SERVICE_ADDRESS: "code-typing-auth-service"
CONSUL_TAGS: "urlprefix-/api/v1/auth"
RABBITMQ_URL: "amqp://guest:guest@rabbitmq:5672/"
networks:
- code-typing
redis:
container_name: redis
image: redis:latest
restart: always
ports:
- "6379:6379"
command: redis-server --loglevel warning
volumes:
- redis:/data
networks:
- code-typing
code-typing-result-service:
container_name: code-typing-result-service-container
image: ghcr.io/ttodoshi/code-typing-result-service:latest
ports:
- "8070:8070"
depends_on:
mongo:
condition: service_healthy
environment:
SPRING_CLOUD_CONSUL_HOST: consul
SPRING_CLOUD_CONSUL_PORT: 8500
SPRING_CLOUD_CONSUL_DISCOVERY_TAGS: "urlprefix-/api/v1/results"
SPRING_DATA_REDIS_HOST: redis
SPRING_DATA_MONGODB_URI: mongodb://admin:pass@mongo:27017
SPRING_RABBITMQ_HOST: rabbitmq
networks:
- code-typing
rabbitmq:
container_name: rabbitmq
image: rabbitmq:3-management-alpine
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 10s
retries: 3
start_period: 5s
volumes:
- ~/.docker-conf/rabbitmq/data/:/var/lib/rabbitmq/
- ~/.docker-conf/rabbitmq/log/:/var/log/rabbitmq
networks:
- code-typing
networks:
code-typing:
driver: bridge
volumes:
postgres:
mongo:
redis: