forked from brokermr810/QuantDinger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
89 lines (83 loc) · 2.31 KB
/
docker-compose.yml
File metadata and controls
89 lines (83 loc) · 2.31 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
# QuantDinger Docker Compose
# Quick start: docker-compose up -d
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:16-alpine
container_name: quantdinger-db
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-quantdinger}
POSTGRES_USER: ${POSTGRES_USER:-quantdinger}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-quantdinger123}
TZ: Asia/Shanghai
volumes:
- postgres_data:/var/lib/postgresql/data
- ./backend_api_python/migrations/init.sql:/docker-entrypoint-initdb.d/01-init.sql
- ./backend_api_python/migrations:/migrations
ports:
- "127.0.0.1:5432:5432"
networks:
- quantdinger-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U quantdinger -d quantdinger"]
interval: 10s
timeout: 5s
retries: 5
# Backend API Service
backend:
build:
context: ./backend_api_python
dockerfile: Dockerfile
container_name: quantdinger-backend
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
ports:
- "127.0.0.1:5000:5000"
volumes:
# Persistent logs
- ./backend_api_python/logs:/app/logs
- ./backend_api_python/data:/app/data
# Configuration file (optional, for development)
- ./backend_api_python/.env:/app/.env
environment:
- PYTHON_API_HOST=0.0.0.0
- PYTHON_API_PORT=5000
- TZ=Asia/Shanghai
# Database connection
- DATABASE_URL=postgresql://${POSTGRES_USER:-quantdinger}:${POSTGRES_PASSWORD:-quantdinger123}@postgres:5432/${POSTGRES_DB:-quantdinger}
- DB_TYPE=postgresql
networks:
- quantdinger-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/api/health"]
interval: 30s
timeout: 10s
retries: 3
# Frontend Web Service
frontend:
build:
context: ./quantdinger_vue
dockerfile: Dockerfile
container_name: quantdinger-frontend
restart: unless-stopped
ports:
- "8888:80"
depends_on:
- backend
networks:
- quantdinger-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3
volumes:
postgres_data:
driver: local
networks:
quantdinger-network:
driver: bridge