-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
35 lines (33 loc) · 894 Bytes
/
Copy pathdocker-compose.yaml
File metadata and controls
35 lines (33 loc) · 894 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
services:
postgres:
image: postgres:12-alpine
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=simple_bank
ports:
- "5432:5432"
volumes:
- data-volume:/var/lib/postgresql/data
redis:
image: redis:7-alpine
api:
build:
# . meanings is current root folder. (Project folder)
context: .
# Dockerfile is in root of the project
dockerfile: Dockerfile
ports:
- "8080:8080"
- "9090:9090"
environment:
- DB_SOURCE=postgresql://root:secret@postgres:5432/simple_bank?sslmode=disable
- REDIS_ADDRESS=redis:6379
# Make sure that the postgres will be started before the api service
depends_on:
- postgres
- redis
entrypoint: ["/app/wait-for.sh", "postgres:5432", "--", "/app/start.sh"]
command: ["/app/main"]
volumes:
data-volume: