Skip to content

Commit 515f107

Browse files
authored
chore: Update Docker compose files to use named volumes (#6704)
* chore: Update Docker compose files to use named volumes * chore: Update Docker compose files to use named volumes (prod)
1 parent 7049167 commit 515f107

28 files changed

+498
-167
lines changed

deploy/dev/docker-compose.cn.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ services:
5858
- POSTGRES_PASSWORD=password
5959
- POSTGRES_DB=postgres
6060
volumes:
61-
- ./pg/data:/var/lib/postgresql/data
61+
- fastgpt-pg:/var/lib/postgresql/data
6262
healthcheck:
6363
test: ['CMD', 'pg_isready', '-U', 'username', '-d', 'postgres']
6464
interval: 5s
@@ -79,7 +79,7 @@ services:
7979
- MONGO_INITDB_ROOT_USERNAME=myusername
8080
- MONGO_INITDB_ROOT_PASSWORD=mypassword
8181
volumes:
82-
- ./mongo/data:/data/db
82+
- fastgpt-mongo:/data/db
8383
healthcheck:
8484
test:
8585
[
@@ -145,9 +145,9 @@ services:
145145
retries: 3
146146
start_period: 30s
147147
volumes:
148-
- ./redis/data:/data
148+
- fastgpt-redis:/data
149149
fastgpt-minio:
150-
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/minio:RELEASE.2025-09-07T16-13-09Z
150+
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/minio:RELEASE.2025-09-07T16-13-09Z # cpu 不支持 AVX 时候使用 RELEASE.2025-09-07T16-13-09Z-cpuv1
151151
container_name: fastgpt-minio
152152
restart: always
153153
networks:
@@ -159,7 +159,7 @@ services:
159159
- MINIO_ROOT_USER=minioadmin
160160
- MINIO_ROOT_PASSWORD=minioadmin
161161
volumes:
162-
- ./fastgpt-minio:/data
162+
- fastgpt-minio:/data
163163
command: server /data --console-address ":9001"
164164
healthcheck:
165165
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
@@ -341,7 +341,7 @@ services:
341341
restart: unless-stopped
342342
container_name: aiproxy_pg
343343
volumes:
344-
- ./aiproxy_pg:/var/lib/postgresql/data
344+
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
345345
networks:
346346
- aiproxy
347347
environment:
@@ -358,6 +358,13 @@ networks:
358358
fastgpt:
359359
aiproxy:
360360

361+
volumes:
362+
fastgpt-pg:
363+
fastgpt-mongo:
364+
fastgpt-redis:
365+
fastgpt-minio:
366+
fastgpt-aiproxy_pg:
367+
361368
configs:
362369
opensandbox-config:
363370
content: |

deploy/dev/docker-compose.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ services:
5858
- POSTGRES_PASSWORD=password
5959
- POSTGRES_DB=postgres
6060
volumes:
61-
- ./pg/data:/var/lib/postgresql/data
61+
- fastgpt-pg:/var/lib/postgresql/data
6262
healthcheck:
6363
test: ['CMD', 'pg_isready', '-U', 'username', '-d', 'postgres']
6464
interval: 5s
@@ -79,7 +79,7 @@ services:
7979
- MONGO_INITDB_ROOT_USERNAME=myusername
8080
- MONGO_INITDB_ROOT_PASSWORD=mypassword
8181
volumes:
82-
- ./mongo/data:/data/db
82+
- fastgpt-mongo:/data/db
8383
healthcheck:
8484
test:
8585
[
@@ -145,9 +145,9 @@ services:
145145
retries: 3
146146
start_period: 30s
147147
volumes:
148-
- ./redis/data:/data
148+
- fastgpt-redis:/data
149149
fastgpt-minio:
150-
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
150+
image: minio/minio:RELEASE.2025-09-07T16-13-09Z # cpu 不支持 AVX 时候使用 RELEASE.2025-09-07T16-13-09Z-cpuv1
151151
container_name: fastgpt-minio
152152
restart: always
153153
networks:
@@ -159,7 +159,7 @@ services:
159159
- MINIO_ROOT_USER=minioadmin
160160
- MINIO_ROOT_PASSWORD=minioadmin
161161
volumes:
162-
- ./fastgpt-minio:/data
162+
- fastgpt-minio:/data
163163
command: server /data --console-address ":9001"
164164
healthcheck:
165165
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
@@ -341,7 +341,7 @@ services:
341341
restart: unless-stopped
342342
container_name: aiproxy_pg
343343
volumes:
344-
- ./aiproxy_pg:/var/lib/postgresql/data
344+
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
345345
networks:
346346
- aiproxy
347347
environment:
@@ -358,6 +358,13 @@ networks:
358358
fastgpt:
359359
aiproxy:
360360

361+
volumes:
362+
fastgpt-pg:
363+
fastgpt-mongo:
364+
fastgpt-redis:
365+
fastgpt-minio:
366+
fastgpt-aiproxy_pg:
367+
361368
configs:
362369
opensandbox-config:
363370
content: |

deploy/docker/cn/docker-compose.milvus.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ services:
5656
networks:
5757
- vector
5858
volumes:
59-
- ./milvus-minio:/minio_data
59+
- fastgpt-milvus-minio:/minio_data
6060
command: minio server /minio_data --console-address ":9001"
6161
healthcheck:
6262
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
@@ -75,7 +75,7 @@ services:
7575
networks:
7676
- vector
7777
volumes:
78-
- ./milvus/etcd:/etcd
78+
- fastgpt-milvus-etcd:/etcd
7979
command: etcd -advertise-client-urls=http://127.0.0.1:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
8080
healthcheck:
8181
test: ['CMD', 'etcdctl', 'endpoint', 'health']
@@ -95,7 +95,7 @@ services:
9595
- fastgpt
9696
- vector
9797
volumes:
98-
- ./milvus/data:/var/lib/milvus
98+
- fastgpt-milvus-data:/var/lib/milvus
9999
healthcheck:
100100
test: ['CMD', 'curl', '-f', 'http://localhost:9091/healthz']
101101
interval: 30s
@@ -105,6 +105,7 @@ services:
105105
depends_on:
106106
- 'milvus-etcd'
107107
- 'milvus-minio'
108+
108109
mongo:
109110
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
110111
container_name: mongo
@@ -116,7 +117,7 @@ services:
116117
- MONGO_INITDB_ROOT_USERNAME=myusername
117118
- MONGO_INITDB_ROOT_PASSWORD=mypassword
118119
volumes:
119-
- ./mongo/data:/data/db
120+
- fastgpt-mongo:/data/db
120121
healthcheck:
121122
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
122123
interval: 10s
@@ -168,7 +169,7 @@ services:
168169
retries: 3
169170
start_period: 30s
170171
volumes:
171-
- ./redis/data:/data
172+
- fastgpt-redis:/data
172173
fastgpt-minio:
173174
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/minio:RELEASE.2025-09-07T16-13-09Z
174175
container_name: fastgpt-minio
@@ -182,7 +183,7 @@ services:
182183
- MINIO_ROOT_USER=minioadmin
183184
- MINIO_ROOT_PASSWORD=minioadmin
184185
volumes:
185-
- ./fastgpt-minio:/data
186+
- fastgpt-minio:/data
186187
command: server /data --console-address ":9001"
187188
healthcheck:
188189
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
@@ -445,7 +446,7 @@ services:
445446
restart: unless-stopped
446447
container_name: aiproxy_pg
447448
volumes:
448-
- ./aiproxy_pg:/var/lib/postgresql/data
449+
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
449450
networks:
450451
- aiproxy
451452
environment:
@@ -463,6 +464,20 @@ networks:
463464
aiproxy:
464465
vector:
465466

467+
volumes:
468+
fastgpt-pg:
469+
fastgpt-mongo:
470+
fastgpt-redis:
471+
fastgpt-minio:
472+
fastgpt-milvus-minio:
473+
fastgpt-milvus-etcd:
474+
fastgpt-milvus-data:
475+
fastgpt-ob-data:
476+
fastgpt-ob-config:
477+
fastgpt-seekdb-data:
478+
fastgpt-seekdb-config:
479+
fastgpt-aiproxy_pg:
480+
466481
configs:
467482
opensandbox-config:
468483
content: |
@@ -483,4 +498,4 @@ configs:
483498
# 容器内访问宿主机服务时需要设置为宿主机 IP 或 hostname
484499
# macOS/Windows: host.docker.internal;Linux: 宿主机 LAN IP(如 192.168.1.100)
485500
host_ip = "host.docker.internal"
486-
501+

deploy/docker/cn/docker-compose.oceanbase.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ services:
6666
- OB_SERVER_IP=127.0.0.1
6767
# 更多环境变量配置见oceanbase官方文档: https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000002013494
6868
volumes:
69-
- ./ob/data:/root/ob
70-
- ./ob/config:/root/.obd/cluster
69+
- fastgpt-ob-data:/root/ob
70+
- fastgpt-ob-config:/root/.obd/cluster
7171
configs:
7272
- source: init_sql
7373
target: /root/boot/init.d/init.sql
@@ -82,6 +82,7 @@ services:
8282
timeout: 10s
8383
retries: 1000
8484
start_period: 10s
85+
8586
mongo:
8687
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
8788
container_name: mongo
@@ -93,7 +94,7 @@ services:
9394
- MONGO_INITDB_ROOT_USERNAME=myusername
9495
- MONGO_INITDB_ROOT_PASSWORD=mypassword
9596
volumes:
96-
- ./mongo/data:/data/db
97+
- fastgpt-mongo:/data/db
9798
healthcheck:
9899
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
99100
interval: 10s
@@ -145,7 +146,7 @@ services:
145146
retries: 3
146147
start_period: 30s
147148
volumes:
148-
- ./redis/data:/data
149+
- fastgpt-redis:/data
149150
fastgpt-minio:
150151
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/minio:RELEASE.2025-09-07T16-13-09Z
151152
container_name: fastgpt-minio
@@ -159,7 +160,7 @@ services:
159160
- MINIO_ROOT_USER=minioadmin
160161
- MINIO_ROOT_PASSWORD=minioadmin
161162
volumes:
162-
- ./fastgpt-minio:/data
163+
- fastgpt-minio:/data
163164
command: server /data --console-address ":9001"
164165
healthcheck:
165166
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
@@ -422,7 +423,7 @@ services:
422423
restart: unless-stopped
423424
container_name: aiproxy_pg
424425
volumes:
425-
- ./aiproxy_pg:/var/lib/postgresql/data
426+
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
426427
networks:
427428
- aiproxy
428429
environment:
@@ -440,6 +441,20 @@ networks:
440441
aiproxy:
441442
vector:
442443

444+
volumes:
445+
fastgpt-pg:
446+
fastgpt-mongo:
447+
fastgpt-redis:
448+
fastgpt-minio:
449+
fastgpt-milvus-minio:
450+
fastgpt-milvus-etcd:
451+
fastgpt-milvus-data:
452+
fastgpt-ob-data:
453+
fastgpt-ob-config:
454+
fastgpt-seekdb-data:
455+
fastgpt-seekdb-config:
456+
fastgpt-aiproxy_pg:
457+
443458
configs:
444459
opensandbox-config:
445460
content: |
@@ -464,4 +479,4 @@ configs:
464479
name: init_sql
465480
content: |
466481
ALTER SYSTEM SET ob_vector_memory_limit_percentage = 30;
467-
482+

deploy/docker/cn/docker-compose.pg.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,13 @@ services:
5757
- POSTGRES_PASSWORD=password
5858
- POSTGRES_DB=postgres
5959
volumes:
60-
- ./pg/data:/var/lib/postgresql/data
60+
- fastgpt-pg:/var/lib/postgresql/data
6161
healthcheck:
6262
test: ['CMD', 'pg_isready', '-U', 'username', '-d', 'postgres']
6363
interval: 5s
6464
timeout: 5s
6565
retries: 10
66+
6667
mongo:
6768
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.32 # cpu 不支持 AVX 时候使用 4.4.29
6869
container_name: mongo
@@ -74,7 +75,7 @@ services:
7475
- MONGO_INITDB_ROOT_USERNAME=myusername
7576
- MONGO_INITDB_ROOT_PASSWORD=mypassword
7677
volumes:
77-
- ./mongo/data:/data/db
78+
- fastgpt-mongo:/data/db
7879
healthcheck:
7980
test: ['CMD', 'mongo', '-u', 'myusername', '-p', 'mypassword', '--authenticationDatabase', 'admin', '--eval', "db.adminCommand('ping')"]
8081
interval: 10s
@@ -126,7 +127,7 @@ services:
126127
retries: 3
127128
start_period: 30s
128129
volumes:
129-
- ./redis/data:/data
130+
- fastgpt-redis:/data
130131
fastgpt-minio:
131132
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/minio:RELEASE.2025-09-07T16-13-09Z
132133
container_name: fastgpt-minio
@@ -140,7 +141,7 @@ services:
140141
- MINIO_ROOT_USER=minioadmin
141142
- MINIO_ROOT_PASSWORD=minioadmin
142143
volumes:
143-
- ./fastgpt-minio:/data
144+
- fastgpt-minio:/data
144145
command: server /data --console-address ":9001"
145146
healthcheck:
146147
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
@@ -403,7 +404,7 @@ services:
403404
restart: unless-stopped
404405
container_name: aiproxy_pg
405406
volumes:
406-
- ./aiproxy_pg:/var/lib/postgresql/data
407+
- fastgpt-aiproxy_pg:/var/lib/postgresql/data
407408
networks:
408409
- aiproxy
409410
environment:
@@ -421,6 +422,20 @@ networks:
421422
aiproxy:
422423
vector:
423424

425+
volumes:
426+
fastgpt-pg:
427+
fastgpt-mongo:
428+
fastgpt-redis:
429+
fastgpt-minio:
430+
fastgpt-milvus-minio:
431+
fastgpt-milvus-etcd:
432+
fastgpt-milvus-data:
433+
fastgpt-ob-data:
434+
fastgpt-ob-config:
435+
fastgpt-seekdb-data:
436+
fastgpt-seekdb-config:
437+
fastgpt-aiproxy_pg:
438+
424439
configs:
425440
opensandbox-config:
426441
content: |
@@ -441,4 +456,4 @@ configs:
441456
# 容器内访问宿主机服务时需要设置为宿主机 IP 或 hostname
442457
# macOS/Windows: host.docker.internal;Linux: 宿主机 LAN IP(如 192.168.1.100)
443458
host_ip = "host.docker.internal"
444-
459+

0 commit comments

Comments
 (0)