generated from yandex-praktikum/java-shareit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
42 lines (38 loc) · 934 Bytes
/
docker-compose.yaml
File metadata and controls
42 lines (38 loc) · 934 Bytes
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
version: '3.8'
volumes:
postgres_data:
services:
db:
image: postgres:16.1
ports:
- "5432:5432"
environment:
POSTGRES_USER: dbuser
POSTGRES_PASSWORD: 12345
POSTGRES_DB: shareit
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dbuser -d shareit"]
server:
build:
context: .
dockerfile: server/Dockerfile
ports:
- "9090:9090"
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/shareit # ← db вместо postgres
- SPRING_DATASOURCE_USERNAME=dbuser
- SPRING_DATASOURCE_PASSWORD=12345
depends_on:
- db # ← зависит от db, а не postgres
gateway:
build:
context: .
dockerfile: gateway/Dockerfile
ports:
- "8080:8080"
environment:
- SHAREIT_SERVER_URL=http://server:9090
depends_on:
- server