-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
120 lines (113 loc) · 3.53 KB
/
docker-compose.yml
File metadata and controls
120 lines (113 loc) · 3.53 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
# =============================================================================
# B&R Capital Dashboard - Development Docker Compose
# =============================================================================
# Local development environment with hot-reload and debugging support
# Usage: docker-compose up -d
# =============================================================================
version: '3.8'
services:
# ---------------------------------------------------------------------------
# PostgreSQL Database
# ---------------------------------------------------------------------------
postgres:
image: postgres:15-alpine
container_name: dashboard-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres123
POSTGRES_DB: dashboard_interface_data
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
networks:
- dashboard-network
restart: unless-stopped
# ---------------------------------------------------------------------------
# Redis Cache
# ---------------------------------------------------------------------------
redis:
image: redis:7-alpine
container_name: dashboard-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
networks:
- dashboard-network
restart: unless-stopped
# ---------------------------------------------------------------------------
# Backend API (FastAPI)
# ---------------------------------------------------------------------------
backend:
build:
context: ./backend
target: development
container_name: dashboard-backend
environment:
- DATABASE_URL=postgresql://postgres:postgres123@postgres:5432/dashboard_interface_data
- REDIS_URL=redis://redis:6379/0
- SECRET_KEY=${SECRET_KEY:?SECRET_KEY is required - set in .env}
- ENVIRONMENT=development
- DEBUG=true
- LOG_LEVEL=debug
- HOST=0.0.0.0
- PORT=8000
ports:
- "8000:8000"
volumes:
- ./backend:/app
- backend_logs:/app/logs
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- dashboard-network
restart: unless-stopped
# ---------------------------------------------------------------------------
# Frontend (React + Vite via Nginx)
# ---------------------------------------------------------------------------
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
target: production
container_name: dashboard-frontend
ports:
- "5173:80"
depends_on:
- backend
environment:
- VITE_API_URL=http://localhost:8000
networks:
- dashboard-network
restart: unless-stopped
# =============================================================================
# Networks
# =============================================================================
networks:
dashboard-network:
driver: bridge
name: dashboard-network
# =============================================================================
# Volumes
# =============================================================================
volumes:
postgres_data:
name: dashboard-postgres-data
redis_data:
name: dashboard-redis-data
backend_logs:
name: dashboard-backend-logs