-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
62 lines (59 loc) · 1.42 KB
/
docker-compose.yml
File metadata and controls
62 lines (59 loc) · 1.42 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
services:
tracer:
image: tracer:${VERSION:-dev}
container_name: tracer
restart: always
build:
context: .
dockerfile: Dockerfile.dev
env_file:
- .env
ports:
- ${SERVER_PORT}:${SERVER_PORT}
volumes:
- .:/usr/src/app
depends_on:
tracer-postgres:
condition: service_healthy
# Note: healthcheck uses wget which is included in Alpine base image
# Production (Kubernetes) uses liveness/readiness probes instead
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:${SERVER_PORT}/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
deploy:
resources:
limits:
cpus: '1'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
networks:
- tracer-network
tracer-postgres:
image: postgres:16-alpine
container_name: tracer-postgres
restart: always
ports:
- ${DB_PORT}:5432
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- tracer-network
volumes:
postgres-data:
networks:
tracer-network:
driver: bridge