-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
76 lines (72 loc) · 2.1 KB
/
docker-compose.yml
File metadata and controls
76 lines (72 loc) · 2.1 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
71
72
73
74
75
76
# Simple Docker Compose for Development
# Quick rebuild: docker compose up -d --build
services:
postgres:
image: postgres:16-alpine
ports:
- "5432:5432"
environment:
POSTGRES_DB: platform_api
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 3s
retries: 5
datadog-agent:
image: gcr.io/datadoghq/agent:7
container_name: datadog-agent
ports:
- "8125:8125/udp" # DogStatsD
- "8126:8126" # APM
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
environment:
- DD_API_KEY=${DD_API_KEY}
- DD_SITE=${DD_SITE}
- DD_LOGS_ENABLED=true
- DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true
- DD_CONTAINER_EXCLUDE="name:datadog-agent"
# Enable OTLP ingestion
- DD_OTLP_CONFIG_RECEIVER_PROTOCOLS_GRPC_ENDPOINT=0.0.0.0:4317
- DD_OTLP_CONFIG_RECEIVER_PROTOCOLS_HTTP_ENDPOINT=0.0.0.0:4318
# Additional settings
- DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true
- DD_APM_ENABLED=true
- DD_APM_NON_LOCAL_TRAFFIC=true
- DD_PROCESS_AGENT_ENABLED=true
- DD_TAGS=env:${ENVIRONMENT:-local} service:cloud-api
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /proc/:/host/proc/:ro
- /sys/fs/cgroup/:/host/sys/fs/cgroup:ro
healthcheck:
test: ["CMD", "agent", "health"]
interval: 10s
timeout: 5s
retries: 3
api:
build: .
ports:
- "3000:3000"
environment:
CONFIG_FILE: config/docker.yaml
RUST_LOG: debug
RUST_BACKTRACE: "1"
# OTLP configuration to send metrics to Datadog agent
TELEMETRY_OTLP_ENDPOINT: http://datadog-agent:4317
TELEMETRY_OTLP_PROTOCOL: grpc
# Environment tag for metrics
ENVIRONMENT: ${ENVIRONMENT:-local}
volumes:
- ./config:/app/config:ro
depends_on:
postgres:
condition: service_healthy
datadog-agent:
condition: service_healthy
volumes:
postgres_data: