# 0.2.1 独立验证部署 (baihu /app/iboard-0.2.1) 与现网 `/app/iboard`(3001/宿主 MySQL) 完全隔离:本栈使用独立 PG 容器、端口 13001/13002,不写原库。 ## 栈 | 服务 | 说明 | | --- | --- | | `pg` | postgres:16-alpine,`wal_level=logical`(供 PowerSync 逻辑复制),数据在 `./data/pg`,**不对外暴露端口** | | `app` | 本仓库 Dockerfile 构建,13001 对外;启动时先 `prisma migrate deploy`;`DISABLE_CRON=1` 关闭定时任务 | | `powersync` | journeyapps/powersync-service,13002 对外;源库=pg,bucket storage=同实例 PG 的 powersync schema | ## 首次部署 ```bash # 服务器上 (源码已上传到 /app/iboard-0.2.1) cd /app/iboard-0.2.1/deploy/0.2.1 # 1. 生成 .env (参照 .env.example; POWERSYNC_JWT_KEY_B64 由 secret 派生) umask 077 PG_PASSWORD=$(openssl rand -hex 16) PS_STORAGE_PASSWORD=$(openssl rand -hex 16) JWT_SECRET_021=$(openssl rand -hex 32) POWERSYNC_JWT_SECRET=$(openssl rand -hex 32) POWERSYNC_JWT_KEY_B64=$(printf %s "$POWERSYNC_JWT_SECRET" | openssl base64 -A | tr '+/' '-_' | tr -d '=') cat > .env <