Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
101 lines (94 loc) · 3.13 KB
/
Copy pathdocker-compose.yml
File metadata and controls
101 lines (94 loc) · 3.13 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
version: '3.8'
# ==============================================================================
# CodeSentinel Docker Compose Specification
# NOTE: In Phase 1, PostgreSQL, Redis, and Celery worker services are defined
# as foundation placeholders for upcoming phases (Phase 4 integration).
# The current backend container runs the Phase 1 FastAPI health check foundation.
# ==============================================================================
services:
# Database Service (Foundation Placeholder for Phase 4 Persistence)
postgres:
image: postgres:16-alpine
container_name: codesentinel-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-codesentinel}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-codesentinel_dev_secret_change_me}
POSTGRES_DB: ${POSTGRES_DB:-codesentinel}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-codesentinel}"]
interval: 10s
timeout: 5s
retries: 5
# In-Memory Cache & Message Broker (Foundation Placeholder for Phase 4 Queues)
redis:
image: redis:7-alpine
container_name: codesentinel-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# FastAPI Backend Service
backend:
build:
context: .
dockerfile: backend/Dockerfile
container_name: codesentinel-backend
restart: unless-stopped
ports:
- "8000:8000"
environment:
- ENVIRONMENT=development
- DEBUG=True
- BACKEND_HOST=0.0.0.0
- BACKEND_PORT=8000
- DATABASE_URL=postgresql+asyncpg://${POSTGRES_USER:-codesentinel}:${POSTGRES_PASSWORD:-codesentinel_dev_secret_change_me}@postgres:5432/${POSTGRES_DB:-codesentinel}
- REDIS_URL=redis://redis:6379/0
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
# Asynchronous Task Worker (Phase 11 Celery Worker)
worker:
build:
context: .
dockerfile: backend/Dockerfile
container_name: codesentinel-worker
restart: unless-stopped
command: ["celery", "-A", "backend.app.workers.celery_app:celery_app", "worker", "--loglevel=info", "--concurrency=2", "-Q", "analysis"]
environment:
- ENVIRONMENT=development
- DATABASE_URL=postgresql+asyncpg://${POSTGRES_USER:-codesentinel}:${POSTGRES_PASSWORD:-codesentinel_dev_secret_change_me}@postgres:5432/${POSTGRES_DB:-codesentinel}
- CELERY_BROKER_URL=redis://redis:6379/1
- CELERY_RESULT_BACKEND=redis://redis:6379/2
- REDIS_URL=redis://redis:6379/0
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
# Frontend Dashboard Application
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: codesentinel-frontend
restart: unless-stopped
ports:
- "5173:5173"
depends_on:
- backend
volumes:
postgres_data:
redis_data: