自托管 Maybe 如何更新到新版本拉取 GHCR 镜像并重启 web worker 的步骤【免费下载链接】maybeThe personal finance app for everyone项目地址: https://gitcode.com/GitHub_Trending/ma/maybe你按 Docker 自托管指南 部署了 Maybe 之后版本更新不会自动发生——文档明确说明默认情况下自托管应用不会自动更新。要更新就得在部署 Maybe 的目录下拉取 GHCRGithub Container Registry上已发布的镜像重建并用新版本重启web和worker两个服务。前提条件来自同一份指南的 Setup 章节应用目录里已有compose.yml指南的做法是从仓库的 compose.example.yml 下载并重命名为compose.yml应用当前可以正常启动例如docker compose up后浏览器访问http://localhost:3000能看到 Maybe 登录页。先确认 compose.yml 里引用的镜像 tag更新机制就是compose.yml中的这行镜像引用image: ghcr.io/maybe-finance/maybe:latest文档推荐在以下两个 tag 中二选一也可以固定到任意指定版本ghcr.io/maybe-finance/maybe:latestlatest commit最新提交ghcr.io/maybe-finance/maybe:stablelatest release最新发布版docker compose pull拉取的就是compose.yml中写明的这个镜像所以想换更新的来源比如从latest改为stable先改镜像 tag 再执行后面的步骤。执行更新pull、build、重启 web worker在终端中依次执行目录路径按你实际部署位置替换文档示例使用~/docker-apps/maybecd ~/docker-apps/maybe # Navigate to whatever directory you configured the app in docker compose pull # This pulls the latest published image from GHCR docker compose build # This rebuilds the app with updates docker compose up --no-deps -d web worker # This restarts the app using the newest version三条命令的分工就是文档注释里写的pull从 GHCR 拉取已发布的镜像build用更新后的内容重建应用最后一条用新版本重启应用。最后一条命令只针对web和worker两个服务——对照 compose.example.yml 可以看到只有这两个服务引用ghcr.io/maybe-finance/maybe镜像web默认worker以bundle exec sidekiq启动而db用的是postgres:16、redis用的是redis:latest都不受这次镜像更新影响。可选固定到 stable 或指定版本如果你不想一直跟随latest编辑compose.yml把镜像行改为例如image: ghcr.io/maybe-finance/maybe:stable保存后同样执行docker compose pull、docker compose build然后重启。这里有一处文档内部不一致需要注意指南「How to change which updates your app receives」一节给出的重启命令是docker compose up --no-deps -d app但示例 compose 文件中并没有名为app的服务服务名是web、worker、db、redis而「How to update your app」一节用的则是web worker。如果你沿用的是示例 compose 文件按docker compose up --no-deps -d web worker执行如果自定义过服务名以你自己compose.yml里的服务名为准。更新后如何确认应用在运行文档没有为更新成功定义专门的输出例如某个版本号打印它给出的运行确认方式适用于更新后的重启场景执行docker compose ls文档用它来确认 compose 栈处于运行状态浏览器访问http://localhost:3000看到 Maybe 登录页即说明 web 服务正常响应。worker 服务没有单独的文档级检查命令它的重启由最后一条docker compose up --no-deps -d web worker一并完成。限制数据库重置操作不适用于更新流程指南 Troubleshooting 章节给出的ActiveRecord::DatabaseConnectionError处理方式——docker compose down docker volume rm maybe_postgres-data # this is the name of the volume the DB is mounted to docker compose up docker exec -it maybe-postgres-1 psql -U maybe -d maybe_production -c SELECT 1; # This will verify that the issue is fixed明确只针对第一次启动时遇到的数据库连接问题而且文档特别警告docker volume rm会删除 Maybe 数据库里的全部现有数据。它不是更新失败后的修复手段更新流程中不要执行。另外README 注明该仓库不再活跃维护并指向 v0.6.0 作为 final release。这意味着 GHCR 上的latest/stabletag 不会持续收到新提交或新发布更新时能拉到的新版本取决于发布方最后推送的镜像。【免费下载链接】maybeThe personal finance app for everyone项目地址: https://gitcode.com/GitHub_Trending/ma/maybe创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考