version: "3.3"
services:
m3e:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt_docker/m3e-large-api:latest
container_name: m3e
restart: always
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
ports:
- "6008:6008"
volumes:
- ./m3e:/data
networks:
- fastgpt
ollama:
image: ollama/ollama:latest
container_name: ollama
restart: always
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
ports:
- "11434:11434"
volumes:
- ./ollama:/data
networks:
- fastgpt
open-webui:
image: ghcr.nju.edu.cn/open-webui/open-webui:main
container_name: open-webui
restart: always
ports:
- "3030:8080"
volumes:
- ./open-webui:/app/backend/data
depends_on:
- ollama
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- fastgpt
pg:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.7.0
container_name: pg
restart: always
ports:
- 5432:5432
networks:
- fastgpt
environment:
- POSTGRES_USER=username
- POSTGRES_PASSWORD=password
- POSTGRES_DB=postgres
volumes:
- ./pg/data:/var/lib/postgresql/data
mongo:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.18
container_name: mongo
restart: always
ports:
- 27017:27017
networks:
- fastgpt
command: mongod --keyFile /data/mongodb.key --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=myusername
- MONGO_INITDB_ROOT_PASSWORD=mypassword
volumes:
- ./mongo/data:/data/db
entrypoint:
- bash
- -c
- |
openssl rand -base64 128 > /data/mongodb.key
chmod 400 /data/mongodb.key
chown 999:999 /data/mongodb.key
echo 'const isInited = rs.status().ok === 1
if(!isInited){
rs.initiate({
_id: "rs0",
members: [
{ _id: 0, host: "mongo:27017" }
]
})
}' > /data/initReplicaSet.js
# 启动MongoDB服务
exec docker-entrypoint.sh "$$@" &
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')" > /dev/null 2>&1; do
echo "Waiting for MongoDB to start..."
sleep 2
done
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
wait $$!
sandbox:
container_name: sandbox
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:latest
networks:
- fastgpt
restart: always
fastgpt:
container_name: fastgpt
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.6
ports:
- 3000:3000
networks:
- fastgpt
depends_on:
- mongo
- pg
- sandbox
restart: always
environment:
- DEFAULT_ROOT_PSW=1234
- OPENAI_BASE_URL=http://10.31.1.27:3001/v1
- CHAT_API_KEY=sk-DLpgt86aHsrLYuSh68F2Df050e1543DaA18dD3D773E14a67
- DB_MAX_LINK=30
- TOKEN_KEY=any
- ROOT_KEY=root_key
- FILE_TOKEN_KEY=filetoken
- MONGODB_URI=mongodb://myusername:mypassword@mongo:27017/fastgpt?authSource=admin
- PG_URL=postgresql://username:password@pg:5432/postgres
- SANDBOX_URL=http://sandbox:3000
- LOG_LEVEL=info
- STORE_LOG_LEVEL=warn
volumes:
- ./config.json:/app/data/config.json
mysql:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mysql:8.0.36
container_name: mysql
restart: always
ports:
- 3306:3306
networks:
- fastgpt
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: oneapimmysql
MYSQL_DATABASE: oneapi
volumes:
- ./mysql:/var/lib/mysql
oneapi:
container_name: oneapi
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/one-api:v0.6.6
ports:
- 3001:3000
depends_on:
- mysql
networks:
- fastgpt
restart: always
environment:
- SQL_DSN=root:oneapimmysql@tcp(mysql:3306)/oneapi
- SESSION_SECRET=oneapikey
- MEMORY_CACHE_ENABLED=true
- BATCH_UPDATE_ENABLED=true
- BATCH_UPDATE_INTERVAL=10
- INITIAL_ROOT_TOKEN=fastgpt
volumes:
- ./oneapi:/data
networks:
fastgpt: