-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
106 lines (98 loc) · 2.43 KB
/
docker-compose.yml
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
version: '3.8'
services:
backend:
build: ./server
container_name: fortune-backend
restart: always
environment:
- DATABASE_URI=postgresql+asyncpg://postgres:postgres@db:5432/fortune_platform
- REDIS_HOST=redis
- REDIS_PORT=6379
- SECRET_KEY=${SECRET_KEY}
- OPENAI_API_KEY=${OPENAI_API_KEY}
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
networks:
- fortune-network
frontend:
build: ./web
container_name: fortune-frontend
restart: always
ports:
- "80:80"
depends_on:
- backend
networks:
- fortune-network
environment:
- VITE_APP_NAME=天机阁占卜平台
- VITE_APP_HOMEPAGE=https://sanshengshui.com
- VITE_APP_AUTHOR=仲戌字
db:
image: postgres:14-alpine
container_name: fortune-db
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=fortune_platform
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
- fortune-network
redis:
image: redis:alpine
container_name: fortune-redis
restart: always
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- fortune-network
prometheus:
image: prom/prometheus:latest
container_name: fortune-prometheus
restart: always
volumes:
- ./prometheus:/etc/prometheus
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
networks:
- fortune-network
grafana:
image: grafana/grafana:latest
container_name: fortune-grafana
restart: always
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
volumes:
- grafana_data:/var/lib/grafana
depends_on:
- prometheus
networks:
- fortune-network
volumes:
postgres_data:
redis_data:
prometheus_data:
grafana_data:
networks:
fortune-network:
driver: bridge