-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
42 lines (42 loc) · 1.07 KB
/
docker-compose.yaml
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: "2.24.5"
services:
postgres:
image: postgres:16.1-alpine
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=bank
ports:
- "5432:5432"
volumes:
- data-volume:/var/lib/postgresql/data
redis:
image: redis:7.2.4-alpine
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d bank" ]
interval: 5s
timeout: 5s
retries: 5
api:
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
- "9090:9090"
environment:
- DB_SOURCE=postgresql://root:secret@postgres:5432/bank?sslmode=disable
- REDIS_ADDRESS=redis:6379
depends_on:
- postgres
- redis
entrypoint:
[
"/app/wait-for.sh",
"postgres:5432",
"--",
"/app/start.sh"
]
command: [ "/app/main" ]
volumes:
data-volume: