-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
86 lines (80 loc) · 2.47 KB
/
docker-compose.dev.yml
File metadata and controls
86 lines (80 loc) · 2.47 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
# 本地开发依赖服务
# 用法:docker compose -f docker-compose.dev.yml up -d
# 停止:docker compose -f docker-compose.dev.yml down
# 清除数据:docker compose -f docker-compose.dev.yml down -v
services:
postgres:
image: pgvector/pgvector:pg16
container_name: ruici-postgres
env_file:
- .env
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-302304}
POSTGRES_DB: ${POSTGRES_DB:-ruici_ai_platform}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:6.2.14
container_name: ruici-redis
env_file:
- .env
command: ["redis-server", "--appendonly", "yes", "--requirepass", "${REDIS_PASSWORD:-302304}"]
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD-SHELL", "redis-cli -a ${REDIS_PASSWORD:-302304} ping | grep PONG"]
interval: 5s
timeout: 3s
retries: 5
rustfs:
image: rustfs/rustfs:latest
container_name: ruici-rustfs
command: ["/data"]
env_file:
- .env
environment:
RUSTFS_ACCESS_KEY: ${APP_STORAGE_ACCESS_KEY:-rustfsadmin}
RUSTFS_SECRET_KEY: ${APP_STORAGE_SECRET_KEY:-rustfsadmin}
RUSTFS_CONSOLE_ENABLE: "true"
ports:
- "9000:9000"
- "9001:9001"
volumes:
- rustfs_data:/data
healthcheck:
test: ["CMD-SHELL", "timeout 3 sh -c 'cat < /dev/null > /dev/tcp/localhost/9000' || exit 1"]
interval: 5s
timeout: 3s
retries: 5
createbuckets:
image: minio/mc
env_file:
- .env
depends_on:
rustfs:
condition: service_healthy
entrypoint: >
/bin/sh -c "
/usr/bin/mc alias set mys3 http://rustfs:9000 ${APP_STORAGE_ACCESS_KEY:-rustfsadmin} ${APP_STORAGE_SECRET_KEY:-rustfsadmin};
/usr/bin/mc mb --ignore-existing mys3/${APP_STORAGE_BUCKET:-ruici-ai-platform};
/usr/bin/mc anonymous set public mys3/${APP_STORAGE_BUCKET:-ruici-ai-platform};
exit 0;
"
# 首次启动后,浏览器访问 http://localhost:9001
# 使用 APP_STORAGE_ACCESS_KEY / APP_STORAGE_SECRET_KEY 登录。
# 新手注意:dev 编排已自动创建 bucket(默认 ruici-ai-platform)。
volumes:
postgres_data:
redis_data:
rustfs_data: