forked from fiap-8soat-tc-one/tc-backend-s3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
64 lines (61 loc) · 1.42 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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
redis:
image: redis:7.4.2-alpine
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ]
interval: 1s
timeout: 3s
retries: 5
command: [ "redis-server" ]
restart: always
ports:
- 6379:6379
volumes:
- cache_data:/data
tc-auth-backend:
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
build:
context: .
container_name: tc-auth-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
cache_data:
external: false