generated from yandex-praktikum/java-explore-with-me
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
74 lines (71 loc) · 1.72 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
version: '3.8'
services:
# Stats
stats-server:
build: ./stats
container_name: stats_server
restart: always
ports:
- "9090:9090"
depends_on:
stats-db:
condition: service_healthy
environment:
- WAIT_HOSTS=stats-db:5432
- SPRING_DATASOURCE_URL=jdbc:postgresql://stats-db:5432/stats
- POSTGRES_USER=sa
- POSTGRES_PASSWORD=password
# база данных для Stats
stats-db:
image: postgres:14.5-alpine
container_name: stats_db
restart: always
volumes:
- /var/lib/postgresql/data/
ports:
- "6590:5432"
# переменные окружения
environment:
POSTGRES_DB: stats
POSTGRES_USER: sa
POSTGRES_PASSWORD: password
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
# Main
ewm-service:
build: ./main
container_name: main_server
restart: always
ports:
- "8080:8080"
depends_on:
ewm-db:
condition: service_healthy
environment:
- WAIT_HOSTS=ewm-db:5432
- SPRING_DATASOURCE_URL=jdbc:postgresql://ewm-db:5432/ewm
- POSTGRES_USER=sa
- POSTGRES_PASSWORD=password
- STATS_SERVER_URL=http://stats-server:9090
# база для MAIn
ewm-db:
image: postgres:14.5-alpine
container_name: ewm_db
restart: always
volumes:
- /var/lib/postgresql/data/
ports:
- "6580:5432"
# переменные окружения
environment:
POSTGRES_DB: ewm
POSTGRES_USER: sa
POSTGRES_PASSWORD: password
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5