-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
144 lines (131 loc) · 3.74 KB
/
Copy pathdocker-compose.yml
File metadata and controls
144 lines (131 loc) · 3.74 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
version: "3.9"
services:
postgres:
image: postgres:16-alpine
container_name: securereview_postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-}
POSTGRES_USER: ${POSTGRES_USER:-}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- securereview_net
redis:
image: redis:7-alpine
container_name: securereview_redis
restart: unless-stopped
command: redis-server --requirepass ${REDIS_PASSWORD:-}
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "--pass", "${REDIS_PASSWORD}", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- securereview_net
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: securereview_backend
restart: unless-stopped
environment:
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379/0
SECRET_KEY: ${SECRET_KEY:-}
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
AI_PROVIDER: ${AI_PROVIDER:-gemini}
OLLAMA_BASE_URL: ${OLLAMA_BASE_URL:-http://ollama:11434}
ENVIRONMENT: ${ENVIRONMENT:-development}
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-http://localhost:3000,http://localhost:5173}
MAX_FILE_SIZE_MB: ${MAX_FILE_SIZE_MB:-50}
UPLOAD_DIR: /app/uploads
volumes:
- uploads_data:/app/uploads
- ./backend:/app
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
command: >
sh -c "uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload"
networks:
- securereview_net
celery_worker:
build:
context: ./backend
dockerfile: Dockerfile
container_name: securereview_worker
restart: unless-stopped
environment:
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379/0
SECRET_KEY: ${SECRET_KEY:-}
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
AI_PROVIDER: ${AI_PROVIDER:-gemini}
OLLAMA_BASE_URL: ${OLLAMA_BASE_URL:-http://ollama:11434}
UPLOAD_DIR: /app/uploads
volumes:
- uploads_data:/app/uploads
- ./backend:/app
command: celery -A app.workers.celery_app worker --loglevel=info --concurrency=4 -Q scans
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- securereview_net
flower:
build:
context: ./backend
dockerfile: Dockerfile
container_name: securereview_flower
restart: unless-stopped
environment:
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379/0
command: celery -A app.workers.celery_app flower --port=5555 --broker=redis://:${REDIS_PASSWORD}@redis:6379/0
ports:
- "5555:5555"
depends_on:
- redis
- celery_worker
networks:
- securereview_net
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: securereview_frontend
restart: unless-stopped
environment:
VITE_API_URL: ${VITE_API_URL:-http://localhost:8000}
VITE_WS_URL: ${VITE_WS_URL:-ws://localhost:8000}
ports:
- "3000:80"
depends_on:
- backend
networks:
- securereview_net
volumes:
postgres_data:
redis_data:
uploads_data:
networks:
securereview_net:
driver: bridge