-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
47 lines (44 loc) · 1.02 KB
/
docker-compose.yml
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
name: stock-api
services:
stock_api:
image: fiap-3soat-g15-stock-api:latest
container_name: stock_api
build:
context: .
dockerfile: Dockerfile
depends_on:
stock_db:
condition: service_healthy
environment:
DB_ENDPOINT: stock_db:5432
DB_NAME: stock
DB_USERNAME: selforder
DB_PASSWORD: self@Order123!
ports:
- "8081:8081"
restart: always
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8081/actuator/health"]
interval: 10s
timeout: 5s
retries: 5
stock_db:
image: postgres:15.4
container_name: stock_db
volumes:
- stock_db:/var/lib/postgresql/data
environment:
POSTGRES_DB: stock
POSTGRES_USER: selforder
POSTGRES_PASSWORD: self@Order123!
ports:
- "5432:5432"
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 5s
retries: 5
volumes:
stock_db:
driver: local