-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
91 lines (85 loc) · 2.08 KB
/
Copy pathdocker-compose.yml
File metadata and controls
91 lines (85 loc) · 2.08 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
version: "3.9"
services:
# Database initialization service
db-init:
build:
context: ./backend
container_name: db_init
depends_on:
clickhouse:
condition: service_healthy
environment:
- CLICKHOUSE_HOST=clickhouse
- CLICKHOUSE_HTTP_PORT=8123
- CLICKHOUSE_USER=default
- CLICKHOUSE_PASSWORD=clickhouse123
- CLICKHOUSE_DB=default
command: ["python", "init_db.py"]
networks:
- app_network
backend:
build:
context: ./backend
container_name: backend
ports:
- "8000:8000"
depends_on:
- db-init
environment:
- CLICKHOUSE_HOST=clickhouse
- CLICKHOUSE_HTTP_PORT=8123
- CLICKHOUSE_USER=default
- CLICKHOUSE_PASSWORD=clickhouse123
- CLICKHOUSE_DB=default
- UV_COMPILE_BYTECODE=1
- UV_LINK_MODE=copy
command: ["fastapi", "run", "--workers", "4", "app/main.py"]
networks:
- app_network
frontend:
build:
context: ./frontend
args:
NEXT_PUBLIC_API_URL: http://backend:8000
container_name: frontend
ports:
- "3000:3000"
depends_on:
- backend
environment:
- NODE_ENV=production
- NEXT_PUBLIC_API_URL=http://backend:8000
networks:
- app_network
clickhouse:
image: clickhouse/clickhouse-server:latest
container_name: clickhouse_db
restart: always
ports:
- "9001:9000" # Native TCP interface mapped to host port 9001
- "8123:8123" # HTTP interface
environment:
- CLICKHOUSE_DB=default
- CLICKHOUSE_USER=default
- CLICKHOUSE_PASSWORD=clickhouse123
ulimits:
nofile:
soft: 262144
hard: 262144
volumes:
- clickhouse_data:/var/lib/clickhouse
- clickhouse_logs:/var/log/clickhouse-server
networks:
- app_network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8123/ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
volumes:
clickhouse_data:
clickhouse_logs:
networks:
app_network:
driver: bridge