Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
133 lines (123 loc) · 3.98 KB
/
Copy pathdocker-compose.yml
File metadata and controls
133 lines (123 loc) · 3.98 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
# FirstShift local stack: both halves plus the observability tooling.
# Usage: docker compose up -d (first run builds backend and web images)
name: firstshift
services:
# ---------------------------------------------------------------- data stores
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: firstshift
POSTGRES_PASSWORD: firstshift
POSTGRES_DB: firstshift
# Langfuse keeps its own database in the same instance
POSTGRES_MULTIPLE_DATABASES: langfuse
ports:
- "5433:5432" # host 5433 to avoid clashing with an existing local Postgres
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U firstshift"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
# ------------------------------------------------------------- agent backend
backend:
build:
context: .
dockerfile: Dockerfile.backend
environment:
DATABASE_URL: postgresql+psycopg://firstshift:firstshift@postgres:5432/firstshift
REDIS_URL: redis://redis:6379/0
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
OPENAI_MODEL: ${OPENAI_MODEL:-gpt-4.1-mini}
TWILIO_ACCOUNT_SID: ${TWILIO_ACCOUNT_SID:-}
TWILIO_AUTH_TOKEN: ${TWILIO_AUTH_TOKEN:-}
TWILIO_WHATSAPP_FROM: ${TWILIO_WHATSAPP_FROM:-}
LANGFUSE_PUBLIC_KEY: ${LANGFUSE_PUBLIC_KEY:-}
LANGFUSE_SECRET_KEY: ${LANGFUSE_SECRET_KEY:-}
LANGFUSE_HOST: http://langfuse:3000
SENTRY_DSN: ${SENTRY_DSN:-}
ports:
- "8001:8000" # host 8001 to avoid clashing with an existing local service
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://localhost:8000/health')\""]
interval: 10s
timeout: 5s
retries: 10
worker:
build:
context: .
dockerfile: Dockerfile.backend
command:
["uv", "run", "--no-dev", "celery", "-A", "app.workers.celery_app:celery_app", "worker", "--loglevel=INFO"]
environment:
DATABASE_URL: postgresql+psycopg://firstshift:firstshift@postgres:5432/firstshift
REDIS_URL: redis://redis:6379/0
SENTRY_DSN: ${SENTRY_DSN:-}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
# ------------------------------------------------------------------- console
web:
build:
context: ./web
dockerfile: Dockerfile
environment:
VITE_API_URL: http://localhost:8001
ports:
- "5173:5173"
depends_on:
backend:
condition: service_healthy
# ------------------------------------------------- LLM observability (Langfuse)
langfuse:
image: langfuse/langfuse:2
environment:
DATABASE_URL: postgresql://firstshift:firstshift@postgres:5432/langfuse
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: ${LANGFUSE_NEXTAUTH_SECRET:-changeme-generate-a-real-secret}
SALT: ${LANGFUSE_SALT:-changeme-generate-a-real-salt}
TELEMETRY_ENABLED: "false"
ports:
- "3000:3000"
depends_on:
postgres:
condition: service_healthy
# ---------------------------------------------- metrics (Grafana + Prometheus)
prometheus:
image: prom/prometheus:v3.1.0
volumes:
- ./ops/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
ports:
- "9090:9090"
grafana:
image: grafana/grafana:11.5.1
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-admin}
volumes:
- ./ops/grafana/provisioning:/etc/grafana/provisioning:ro
- grafana-data:/var/lib/grafana
ports:
- "3001:3000"
depends_on:
- prometheus
volumes:
postgres-data:
grafana-data: