-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
65 lines (62 loc) · 1.57 KB
/
docker-compose.yaml
File metadata and controls
65 lines (62 loc) · 1.57 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
services:
db:
image: postgres:17.7-alpine3.23
container_name: postgres-db
restart: unless-stopped
ports:
- "5432:5432"
environment:
- POSTGRES_DB=shareit
- POSTGRES_USER=shareit_user
- POSTGRES_PASSWORD=secret
volumes:
- postgres-data:/var/lib/postgresql/data/
healthcheck:
test: pg_isready -q -d $$POSTGRES_DB -U $$POSTGRES_USER
timeout: 5s
interval: 5s
retries: 10
server:
image: shareit-server:latest
build:
context: .
dockerfile: server/Dockerfile
container_name: server
restart: unless-stopped
ports:
- "9090:9090"
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/shareit
SPRING_DATASOURCE_USERNAME: shareit_user
SPRING_DATASOURCE_PASSWORD: secret
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:9090/actuator/health || exit 1
interval: 30s
timeout: 5s
start_period: 30s
retries: 5
depends_on:
db:
condition: service_healthy
gateway:
image: shareit-gateway:latest
build:
context: .
dockerfile: gateway/Dockerfile
container_name: gateway
restart: unless-stopped
ports:
- "8080:8080"
environment:
SHAREIT_SERVER_URL: http://server:9090
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8080/actuator/health || exit 1
interval: 30s
timeout: 5s
start_period: 30s
retries: 5
depends_on:
server:
condition: service_healthy
volumes:
postgres-data: