File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919
2020``` bash
2121# Use latest version (default config file)
22- VITE_API_BASE=http://< your-ip-address> :3000 docker-compose up -d
22+ VITE_API_BASE=http://< your-ip-address> :18000 docker-compose up -d
2323
2424# Use specific version
2525IMAGE_TAG=v1.0.0 docker-compose up -d
@@ -33,8 +33,8 @@ git clone https://github.com/Rabithua/Rote.git
3333cd Rote
3434
3535# Build and start from source
36- # VITE_API_BASE is injected into frontend code at build time (optional, default http://localhost:3000 )
37- VITE_API_BASE=http://localhost:3000 docker-compose -f docker-compose.build.yml up -d --build
36+ # VITE_API_BASE is injected into frontend code at build time (optional, default http://localhost:18000 )
37+ VITE_API_BASE=http://localhost:18000 docker-compose -f docker-compose.build.yml up -d --build
3838```
3939
4040### Detailed Instructions
Original file line number Diff line number Diff line change 1919
2020``` bash
2121# 使用最新版本(默认配置文件)
22- VITE_API_BASE=http://< your-ip-address> :3000 docker-compose up -d
22+ VITE_API_BASE=http://< your-ip-address> :18000 docker-compose up -d
2323
2424# 使用特定版本
2525IMAGE_TAG=v1.0.0 docker-compose up -d
@@ -33,8 +33,8 @@ git clone https://github.com/Rabithua/Rote.git
3333cd Rote
3434
3535# 从源码构建并启动
36- # VITE_API_BASE 在构建时注入到前端代码中(可选,默认 http://localhost:3000 )
37- VITE_API_BASE=http://localhost:3000 docker-compose -f docker-compose.build.yml up -d --build
36+ # VITE_API_BASE 在构建时注入到前端代码中(可选,默认 http://localhost:18000 )
37+ VITE_API_BASE=http://localhost:18000 docker-compose -f docker-compose.build.yml up -d --build
3838```
3939
4040### 详细说明
Original file line number Diff line number Diff line change @@ -7,36 +7,40 @@ services:
77 # 基础配置 - 必需
88 - POSTGRESQL_URL=postgresql://rote:${POSTGRES_PASSWORD:-rote_password_123}@rote-postgres:5432/rote
99 ports :
10- - " 3000 :3000"
10+ - " 18000 :3000"
1111 depends_on :
1212 rote-postgres :
1313 condition : service_healthy
1414 restart : unless-stopped
1515 # 启动命令:等待数据库就绪后执行数据库迁移并启动服务
16- command : ["sh", "-c", "sleep 15 && bun run dist/server.js"]
16+ # 使用程序化迁移(不依赖 drizzle-kit CLI,适用于生产环境)
17+ command :
18+ [
19+ " sh" ,
20+ " -c" ,
21+ " sleep 15 && bun run dist/scripts/runMigrations.js && bun run dist/server.js" ,
22+ ]
1723
1824 rote-frontend :
1925 build :
2026 context : ./web
2127 dockerfile : Dockerfile
2228 args :
2329 # 构建时传递 VITE_API_BASE(构建时注入到代码中)
24- - VITE_API_BASE=${VITE_API_BASE:-http://localhost:3000 }
30+ - VITE_API_BASE=${VITE_API_BASE:-http://localhost:18000 }
2531 ports :
26- - " 3001 :80"
32+ - " 18001 :80"
2733 depends_on :
2834 - rote-backend
2935 environment :
3036 # 运行时环境变量,用于启动脚本注入配置(如果需要覆盖构建时配置)
31- - VITE_API_BASE=${VITE_API_BASE:-http://localhost:3000 }
37+ - VITE_API_BASE=${VITE_API_BASE:-http://localhost:18000 }
3238 restart : unless-stopped
3339
3440 rote-postgres :
3541 image : postgres:17
3642 container_name : rote-postgres
3743 restart : unless-stopped
38- ports :
39- - " 5432:5432"
4044 environment :
4145 POSTGRES_USER : rote
4246 POSTGRES_PASSWORD : ${POSTGRES_PASSWORD:-rote_password_123}
Original file line number Diff line number Diff line change 1010# - develop: Latest from develop branch (supports multi-platform: amd64, arm64)
1111# - main: Latest from main branch
1212# - v1.0.0: Specific version (if released)
13+ #
14+ # ⚠️ IMPORTANT ⚠️
15+ # Don't forget to set VITE_API_BASE
16+ # Example: VITE_API_BASE=http://<your-ip-address>:18000 or VITE_API_BASE=http://<your-domain>
17+ # Note: If you use a reverse proxy, VITE_API_BASE should be your backend address after the reverse proxy
1318
1419services :
1520 rote-backend :
1621 image : rabithua/rote-backend:${IMAGE_TAG:-develop}
22+ pull_policy : always
1723 container_name : rote-backend
1824 environment :
1925 # 基础配置 - 必需
2026 - POSTGRESQL_URL=postgresql://rote:${POSTGRES_PASSWORD:-rote_password_123}@rote-postgres:5432/rote
2127 ports :
22- - " 3000"
28+ - " 18000: 3000"
2329 depends_on :
2430 rote-postgres :
2531 condition : service_healthy
2632 restart : unless-stopped
27- # 启动命令:等待数据库就绪后执行数据库迁移并启动服务
28- command : ["sh", "-c", "sleep 15 && bun run db:migrate && bun run server.ts"]
33+ # Startup command: wait for the database to be ready, then run migrations and start the backend service
34+ # Uses programmatic migrations (does not rely on drizzle-kit CLI, suitable for production)
35+ command :
36+ [
37+ " sh" ,
38+ " -c" ,
39+ " sleep 15 && bun run dist/scripts/runMigrations.js && bun run dist/server.js" ,
40+ ]
2941
3042 rote-frontend :
3143 image : rabithua/rote-frontend:${IMAGE_TAG:-develop}
44+ pull_policy : always
3245 container_name : rote-frontend
3346 ports :
34- - " 3001 "
47+ - " 18001:80 "
3548 depends_on :
3649 - rote-backend
3750 environment :
38- - VITE_API_BASE=${VITE_API_BASE:-http://localhost:3000 }
51+ - VITE_API_BASE=${VITE_API_BASE:-http://<your-ip-address>:18000 }
3952 restart : unless-stopped
4053
4154 rote-postgres :
4255 image : postgres:17
4356 container_name : rote-postgres
4457 restart : unless-stopped
45- ports :
46- - " 5432"
4758 environment :
4859 POSTGRES_USER : rote
4960 POSTGRES_PASSWORD : ${POSTGRES_PASSWORD:-rote_password_123}
You can’t perform that action at this time.
0 commit comments