forked from fiap-8soat-tc-one/tc-backend
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
47 lines (45 loc) · 1.12 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
version: "3.9"
services:
postgres:
image: postgres:15.3-alpine
container_name: tc-postgres
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- 5432:5432
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER}" ]
interval: 10s
timeout: 5s
retries: 5
tc-backend:
depends_on:
postgres:
condition: service_healthy
# image: jcmds/fiap-8soat-tc
build:
context: .
container_name: tc-backend
ports:
- 8080:8080
restart: always
environment:
DATABASE_HOST: postgres
DATABASE_USER: ${POSTGRES_USER}
DATABASE_PASS: ${POSTGRES_PASSWORD}
DATABASE_PORT: 5432
DATABASE_NAME: ${POSTGRES_DB}
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/api/public/v1/health" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
volumes:
pgdata:
external: false