-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
125 lines (118 loc) · 3.23 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
version: '3'
services:
backend:
build: ./backend
runtime: nvidia
volumes:
- ./backend/backend:/backend
- ./backend/uploads:/uploads
- ./backend/IRDIP:/IRDIP
- ./backend/homepage:/homepage
- ./backend/PDC_predict:/PDC_predict
- ./backend/avatars:/avatars
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
ports:
- "8000:8000"
depends_on:
- db
environment:
- DATABASE_URL=mysql://...
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- DB_HOST=db
- EMAIL_HOST_USER=${EMAIL_HOST_USER}
- EMAIL_HOST_PASSWORD=${EMAIL_HOST_PASSWORD}
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
- REDIS_PASSWORD=${REDIS_PASSWORD}
- MINIO_PUBLIC_URL=${MINIO_PUBLIC_URL}
- MINIO_ENDPOINT=${MINIO_ENDPOINT}
- MINIO_ROOT_USER=${MINIO_ROOT_USER}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}
networks:
- my_network
frontend:
build: ./frontend
volumes:
- ./frontend:/app
ports:
- "3000:80"
- "443:443"
environment:
- REACT_APP_OPENAI_API_KEY=${REACT_APP_OPENAI_API_KEY}
- REACT_APP_GAODE_MAP_KEY=${REACT_APP_GAODE_MAP_KEY}
- REACT_APP_TENCENT_MAP_KEY=${REACT_APP_TENCENT_MAP_KEY}
depends_on:
- backend
networks:
- my_network
homepage:
build: ./homepage
ports:
- "3001:3001"
networks:
- my_network
db:
image: mysql:8.0
volumes:
- mysql_data:/var/lib/mysql
ports:
- "3333:3306"
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
timeout: 20s
retries: 10
networks:
- my_network
minio:
build:
context: ./minio # Dockerfile 所在的目录
volumes:
- minio_data:/data # 映射命名卷到 MinIO 的数据目录
- ./minio/ssl:/root/.minio
# - minio_config:/root/.minio # 映射命名卷到 MinIO 的配置目录
ports:
- "9000:9000"
- "9001:9001" # Console 端口
environment:
MINIO_ROOT_USER: "MINIOROOT"
MINIO_ROOT_PASSWORD: "root1234@"
MINIO_SERVER_URL : "http://irdip.com.cn:9000"
MINIO_BROWSER_REDIRECT_URL: "http://irdip.com.cn:9001"
# MINIO_ACCESS_KEY 控制权限是用这个
privileged: true
command: server --console-address ":9001" /data
networks:
- my_network
redis:
build:
context: ./redis # 指定Dockerfile的位置
command: redis-server --requirepass "${REDIS_PASSWORD}"
ports:
- "6379:6379" # 映射Redis的默认端口 <主机端口>:<容器端口>
volumes:
- redis-data:/var/lib/redis-server/ # 将持久化卷映射到工作目录
networks:
- my_network
volumes:
redis-data: # 定义持久化卷
driver: local # 使用本地卷
mysql_data:
uploads:
minio_data:
networks:
my_network:
driver: bridge