-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
142 lines (136 loc) · 3.86 KB
/
docker-compose.yml
File metadata and controls
142 lines (136 loc) · 3.86 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
services:
# PostgreSQL with pgvector extension
postgres:
image: pgvector/pgvector:pg16
container_name: blockbot-postgres
restart: unless-stopped
environment:
POSTGRES_DB: blockbot
POSTGRES_USER: blockbot
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-devpassword}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/postgres:/docker-entrypoint-initdb.d:ro
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U blockbot -d blockbot"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- blockbot
# Redis for caching, sessions, and job queues
redis:
image: redis:7-alpine
container_name: blockbot-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- blockbot
# LiteLLM proxy for LLM model abstraction (optional - can use OpenAI directly)
litellm:
image: ghcr.io/berriai/litellm:main-v1.55.0
container_name: blockbot-litellm
restart: unless-stopped
ports:
- "4010:4000"
volumes:
- ./litellm-config.yaml:/app/config.yaml
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
command: ["--config", "/app/config.yaml", "--port", "4000"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000/health/liveliness"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
depends_on:
postgres:
condition: service_healthy
networks:
- blockbot
# Backend API
api:
build:
context: .
dockerfile: Dockerfile
container_name: blockbot-api
restart: unless-stopped
ports:
- "3000:3000"
environment:
DATABASE_URL: postgres://blockbot:${POSTGRES_PASSWORD:-devpassword}@postgres:5432/blockbot
REDIS_URL: redis://redis:6379
JWT_SECRET: ${JWT_SECRET}
JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET}
RESEND_API_KEY: ${RESEND_API_KEY:-re_test}
NODE_ENV: ${NODE_ENV:-production}
PORT: 3000
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:3001}
APP_URL: ${APP_URL:-http://localhost:3000}
LITELLM_URL: http://litellm:4000
LITELLM_API_KEY: ${LITELLM_API_KEY:-sk-dev}
OPENAI_API_KEY: ${OPENAI_API_KEY}
# Optional services
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN:-}
WHATSAPP_ACCESS_TOKEN: ${WHATSAPP_ACCESS_TOKEN:-}
WHATSAPP_PHONE_NUMBER_ID: ${WHATSAPP_PHONE_NUMBER_ID:-}
WHATSAPP_VERIFY_TOKEN: ${WHATSAPP_VERIFY_TOKEN:-}
WHATSAPP_APP_SECRET: ${WHATSAPP_APP_SECRET:-}
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID:-}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY:-}
S3_BUCKET: ${S3_BUCKET:-}
S3_ENDPOINT: ${S3_ENDPOINT:-}
LINEAR_WEBHOOK_SECRET: ${LINEAR_WEBHOOK_SECRET:-}
GITHUB_APP_ID: ${GITHUB_APP_ID:-}
GITHUB_APP_PRIVATE_KEY: ${GITHUB_APP_PRIVATE_KEY:-}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- blockbot
# Frontend web app
web:
build:
context: ./web
dockerfile: Dockerfile
container_name: blockbot-web
restart: unless-stopped
ports:
- "3001:3001"
environment:
PORT: 3001
HOSTNAME: 0.0.0.0
API_URL: http://api:3000
NEXT_PUBLIC_API_URL: http://localhost:3000/api/v1
depends_on:
api:
condition: service_started
networks:
- blockbot
networks:
blockbot:
driver: bridge
volumes:
postgres_data:
redis_data: