-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
156 lines (150 loc) · 4.75 KB
/
docker-compose.dev.yml
File metadata and controls
156 lines (150 loc) · 4.75 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# Development docker-compose - builds locally with hot reload
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: chad
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-devpassword}
POSTGRES_DB: chad
# Log level: warning (quiet) or log (verbose, shows checkpoints). Dev defaults to verbose.
command: ["postgres", "-c", "log_min_messages=${POSTGRES_LOG_LEVEL:-log}"]
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U chad"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
restart: unless-stopped
command: redis-server --maxmemory 512mb --maxmemory-policy allkeys-lru --appendonly yes --loglevel warning
volumes:
- redis_data:/data
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: ./backend
dockerfile: Dockerfile
environment:
# Database
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_USER=chad
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-devpassword}
- POSTGRES_DB=chad
- DATABASE_POOL_SIZE=${DATABASE_POOL_SIZE:-20}
- DATABASE_MAX_OVERFLOW=${DATABASE_MAX_OVERFLOW:-40}
# Redis
- REDIS_URL=${REDIS_URL:-redis://redis:6379}
# OpenSearch (external)
- OPENSEARCH_HOST=${OPENSEARCH_HOST:-}
- OPENSEARCH_USER=${OPENSEARCH_USER:-}
- OPENSEARCH_PASSWORD=${OPENSEARCH_PASSWORD:-}
# MISP (external)
- MISP_HOST=${MISP_HOST:-}
- MISP_KEY=${MISP_KEY:-}
# Security (CHANGE IN PRODUCTION)
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-dev-secret-key-change-in-prod}
- SESSION_SECRET_KEY=${SESSION_SECRET_KEY:-dev-session-key-change-in-prod}
# Development mode - allows insecure defaults with warning
- DEBUG=true
# Allow webhooks to internal IPs (for testing with mock-webhook service)
- ALLOW_INTERNAL_WEBHOOK_IPS=true
# Frontend URL for SSO redirects (local dev needs explicit URL due to different ports)
- FRONTEND_URL=http://localhost:3000
- APP_URL=http://localhost:3000
# Logging (development uses info for verbose logs)
- LOG_LEVEL=${LOG_LEVEL:-info}
ports:
- "8000:8000"
- "8001:8001" # Direct log ingestion (bypass nginx)
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./backend:/app
- chad_data:/data
# Note: --reload is incompatible with --workers, dev uses single-worker per port
command: >
sh -c "
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload --log-level info --no-access-log &
uvicorn app.main:app --host 0.0.0.0 --port 8001 --log-level info --no-access-log &
wait
"
worker:
build:
context: ./backend
dockerfile: Dockerfile
environment:
# Database
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_USER=chad
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-devpassword}
- POSTGRES_DB=chad
- DATABASE_POOL_SIZE=${DATABASE_POOL_SIZE:-20}
- DATABASE_MAX_OVERFLOW=${DATABASE_MAX_OVERFLOW:-40}
# Redis
- REDIS_URL=${REDIS_URL:-redis://redis:6379}
# Security (CHANGE IN PRODUCTION)
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-dev-secret-key-change-in-prod}
- SESSION_SECRET_KEY=${SESSION_SECRET_KEY:-dev-session-key-change-in-prod}
# Development mode
- DEBUG=true
# Allow webhooks to internal IPs (for testing with mock-webhook service)
- ALLOW_INTERNAL_WEBHOOK_IPS=true
# Logging
- LOG_LEVEL=${LOG_LEVEL:-info}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./backend:/app
# Worker runs without entrypoint (no migrations needed)
entrypoint: []
command: python -m app.worker
# Worker starts by default in dev for testing queue processing
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
depends_on:
- backend
volumes:
- ./frontend:/app
- /app/node_modules
command: npm run dev -- --host 0.0.0.0
# Mock enrichment webhook server for testing custom enrichment webhooks
# Start with: docker compose -f docker-compose.dev.yml up mock-webhook
mock-webhook:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "8888:8888"
volumes:
- ./backend:/app
- ./tools:/app/tools
entrypoint: []
command: python /app/tools/mock_enrichment_webhook.py
profiles:
- testing
volumes:
pgdata:
chad_data:
redis_data: