Repository navigation
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
70 lines (66 loc) · 1.66 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
70 lines (66 loc) · 1.66 KB
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
65
66
67
68
69
70
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-control}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set in .env}
POSTGRES_DB: ${POSTGRES_DB:-control}
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-control}"]
interval: 5s
timeout: 5s
retries: 10
networks:
- data-tier
redis:
image: redis:7-alpine
restart: unless-stopped
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD:?set in .env}"]
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
interval: 5s
timeout: 5s
retries: 10
networks:
- data-tier
api:
build:
context: .
dockerfile: api/Dockerfile
network: host
restart: unless-stopped
ports:
- "8080:8080"
environment:
PORT: "8080"
DATABASE_URL: postgres://${POSTGRES_USER:-control}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-control}?sslmode=disable
REDIS_ADDR: redis:6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
JWT_SECRET: ${JWT_SECRET:?set in .env}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8080/health"]
interval: 10s
timeout: 3s
retries: 5
networks:
- data-tier
- edge-tier
volumes:
postgres-data:
redis-data:
networks:
data-tier:
driver: bridge
internal: true
edge-tier:
driver: bridge