-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
110 lines (98 loc) · 3.62 KB
/
docker-compose.yml
File metadata and controls
110 lines (98 loc) · 3.62 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
version: '3.8'
services:
db:
image: pgvector/pgvector:pg16
environment:
POSTGRES_DB: ${DB_NAME:-crypto_news}
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASS:-postgres}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
crypto-agent:
build: .
volumes:
- ./src:/app/src
- ./news_sources.json:/app/news_sources.json
ports:
- "8000:8000"
environment:
# Database Configuration
- DATABASE_URL=postgresql://${DB_USER:-postgres}:${DB_PASS:-postgres}@db:5432/${DB_NAME:-crypto_news}
- DB_NAME=${DB_NAME:-crypto_news}
- DB_USER=${DB_USER:-postgres}
- DB_PASS=${DB_PASS:-postgres}
# AWS Configuration
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:-us-east-1}
# S3 Configuration
- S3_BUCKET_NAME=${S3_BUCKET_NAME}
- S3_BUCKET_REGION=${S3_BUCKET_REGION:-us-east-1}
# CoinGecko API
- COINGECKO_API_KEY=${COINGECKO_API_KEY}
# API Security
- API_KEY=${API_KEY:-crypto-agent-secret-key}
# Amazon Bedrock Configuration
- AWS_BEDROCK_REGION=${AWS_BEDROCK_REGION:-us-east-1}
- BEDROCK_MODEL_ID=${BEDROCK_MODEL_ID:-anthropic.claude-3-haiku-20240307-v1:0}
- BEDROCK_EMBEDDING_MODEL_ID=${BEDROCK_EMBEDDING_MODEL_ID:-amazon.titan-embed-text-v2:0}
# Application Configuration
- DEBUG=${DEBUG:-true}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
# Observability Configuration
- PROMETHEUS_ENABLED=${PROMETHEUS_ENABLED:-true}
- JAEGER_ENABLED=${JAEGER_ENABLED:-true}
- OTEL_SERVICE_NAME=${OTEL_SERVICE_NAME:-crypto-sentiment-agent}
- OTEL_EXPORTER_JAEGER_ENDPOINT=${OTEL_EXPORTER_JAEGER_ENDPOINT:-http://jaeger:14268/api/traces}
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ./observability/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
ports:
- "9090:9090"
restart: unless-stopped
jaeger:
image: jaegertracing/all-in-one:latest
container_name: jaeger
environment:
- COLLECTOR_ZIPKIN_HOST_PORT=:9411
- COLLECTOR_OTLP_ENABLED=true
ports:
- "5775:5775/udp" # Agent - accept zipkin.thrift over compact thrift protocol
- "6831:6831/udp" # Agent - accept jaeger.thrift over compact thrift protocol
- "6832:6832/udp" # Agent - accept jaeger.thrift over binary thrift protocol
- "5778:5778" # Agent - serve configs
- "16686:16686" # Query - serve frontend
- "14250:14250" # Collector - accept model.proto
- "14268:14268" # Collector - accept jaeger.thrift directly from clients
- "14269:14269" # Collector - health check
- "9411:9411" # Collector - Zipkin compatible endpoint
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
restart: unless-stopped
volumes:
postgres_data:
prometheus_data: