-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (53 loc) · 1.36 KB
/
docker-compose.yml
File metadata and controls
57 lines (53 loc) · 1.36 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
version: '3.8'
services:
gateway:
build: ./gateway
container_name: shareit-gateway
ports:
- "8080:8080"
depends_on:
server:
condition: service_healthy
environment:
- SHAREIT_SERVER_URL=http://server:9090
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
interval: 10s
timeout: 5s
retries: 10
server:
build: ./server
container_name: shareit-server
ports:
- "9090:9090"
depends_on:
db:
condition: service_healthy
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/shareit
- SPRING_DATASOURCE_USERNAME=postgres
- SPRING_DATASOURCE_PASSWORD=postgres
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9090/actuator/health"]
interval: 10s
timeout: 5s
retries: 10
command: ["./wait-for-it.sh", "db:5432", "--timeout=120", "--", "java", "-jar", "app.jar"]
db:
image: postgres:13.7-alpine
container_name: postgres
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=shareit
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
volumes:
postgres_data: