fix(deploy): use ASCII player assets and harden Docker Linux builds
Rename Chinese public paths and image filenames so Vite builds succeed on Linux, strip legacy public dirs in Dockerfiles, and document clean redeploy steps. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -185,10 +185,24 @@ docker exec thebet365-postgres pg_dump -U thebet365 thebet365 > backup.sql
|
||||
|
||||
## 八、更新部署
|
||||
|
||||
**推荐:先删旧代码再解压新 zip**(避免 `packages/shared/public/球员` 等中文目录残留导致 Vite 构建失败)。
|
||||
|
||||
```bash
|
||||
cd /www/wwwroot/thebet365
|
||||
git pull # 或重新上传代码
|
||||
docker compose -f docker-compose.prod.yml --env-file .env.docker up -d --build
|
||||
cd /www/wwwroot
|
||||
mv thebet365 thebet365.bak.$(date +%Y%m%d) # 备份旧目录(保留 .env.docker)
|
||||
mkdir thebet365 && cd thebet365
|
||||
# 上传并解压新 zip 到当前目录
|
||||
cp ../thebet365.bak.*/.env.docker . 2>/dev/null || cp .env.docker.example .env.docker
|
||||
|
||||
docker compose -f docker-compose.prod.yml --env-file .env.docker build --no-cache
|
||||
docker compose -f docker-compose.prod.yml --env-file .env.docker up -d
|
||||
```
|
||||
|
||||
若仍覆盖解压,构建前可手动清理:
|
||||
|
||||
```bash
|
||||
find packages/shared/public -mindepth 1 -maxdepth 1 -type d \
|
||||
! -name flags ! -name players -exec rm -rf {} +
|
||||
```
|
||||
|
||||
API 容器启动时会自动执行 `prisma migrate deploy`,无需手动迁移。
|
||||
@@ -217,6 +231,16 @@ docker logs thebet365-api
|
||||
|
||||
修改 `.env.docker` 中的 `API_PORT` / `PLAYER_PORT` / `ADMIN_PORT` 后重新 `up -d`。
|
||||
|
||||
### 5. player/admin 构建报错 `ENOENT ... packages/shared/public/球员`
|
||||
|
||||
旧版中文目录 `球员` 在 Linux 上编码异常。确认已使用含 `packages/shared/public/players/` 的新代码包,并:
|
||||
|
||||
```bash
|
||||
find packages/shared/public -mindepth 1 -maxdepth 1 -type d \
|
||||
! -name flags ! -name players -exec rm -rf {} +
|
||||
docker compose -f docker-compose.prod.yml --env-file .env.docker build --no-cache player admin
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 十、与本地开发的区别
|
||||
|
||||
Reference in New Issue
Block a user