generated from yandex-praktikum/java-shareit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
62 lines (59 loc) · 1.34 KB
/
docker-compose.yml
File metadata and controls
62 lines (59 loc) · 1.34 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
services:
gateway:
build: gateway
image: gateway
container_name: gateway
ports:
- "8080:8080"
depends_on:
- server
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/" ]
interval: 10s
timeout: 5s
retries: 5
environment:
- SHAREIT_SERVER_URL=http://server:9090
server:
build: server
image: server
container_name: server
ports:
- "9090:9090"
depends_on:
- db
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9090/" ]
interval: 10s
timeout: 5s
retries: 5
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/shareit
- SPRING_DATASOURCE_USERNAME=dbuser
- SPRING_DATASOURCE_PASSWORD=12345
db:
image: postgres:16.1
container_name: postgres
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=12345
- POSTGRES_USER=dbuser
- POSTGRES_DB=shareit
healthcheck:
test: pg_isready -q -d $$POSTGRES_DB -U $$POSTGRES_USER
timeout: 5s
interval: 5s
retries: 10
db-init:
image: postgres:16.1
container_name: db-init
depends_on:
db:
condition: service_healthy
entrypoint:
- bash
- -c
- |
set -e
psql postgresql://dbuser:12345@db:5432/shareit -v ON_ERROR_STOP=1