Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
111 lines (104 loc) · 2.62 KB
/
Copy pathdocker-compose.yml
File metadata and controls
111 lines (104 loc) · 2.62 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
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: ado-postgres
environment:
POSTGRES_USER: ado_user
POSTGRES_PASSWORD: ado_pass
POSTGRES_DB: ado_db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ado_user"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ado-network
# Backend API
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: ado-backend
environment:
DATABASE_URL: postgresql+asyncpg://ado_user:ado_pass@postgres:5432/ado_db
SECRET_KEY: your-secret-key-change-in-production-min-32-chars
DEBUG: "false"
ENVIRONMENT: production
CORS_ORIGINS: http://localhost:3000,http://localhost
LOG_LEVEL: INFO
LOG_FORMAT: json
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
networks:
- ado-network
restart: unless-stopped
# Frontend Dashboard
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: ado-frontend
environment:
VITE_API_URL: http://localhost:8000
VITE_WS_URL: ws://localhost:8000
ports:
- "3000:80"
depends_on:
- backend
networks:
- ado-network
restart: unless-stopped
# Prometheus (Optional - for metrics)
prometheus:
image: prom/prometheus:latest
container_name: ado-prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
networks:
- ado-network
restart: unless-stopped
# Grafana (Optional - for visualization)
grafana:
image: grafana/grafana:latest
container_name: ado-grafana
environment:
GF_SECURITY_ADMIN_PASSWORD: admin
GF_USERS_ALLOW_SIGN_UP: "false"
ports:
- "3001:3000"
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/grafana/dashboards:/etc/grafana/provisioning/dashboards
- ./monitoring/grafana/datasources:/etc/grafana/provisioning/datasources
depends_on:
- prometheus
networks:
- ado-network
restart: unless-stopped
volumes:
postgres_data:
prometheus_data:
grafana_data:
networks:
ado-network:
driver: bridge