Systemd 与容器
原生主机使用 systemd,隔离部署使用 rootless container。
Rootless Podman 运行
podman run --name fluxheim --replace \
-p 8080:8080 \
-v ./fluxheim.toml:/etc/fluxheim/fluxheim.toml:ro \
-v ./site:/srv/site:ro \
-v fluxheim-cache:/var/cache/fluxheim \
ghcr.io/valkyoth/fluxheim:v1.8.0
容器挂载
| 挂载 | Recommended mode |
|---|---|
| 配置 | 只读 bind mount。 |
| 静态内容 | 只读 bind mount。 |
| ACME 状态 | 持久可写 volume。 |
| Disk cache | 使用容量符合 cache policy 的持久 writable volume。为每个 storage-bin replica 分配独立的 local 或 RWO volume;只有在跨 node locking 已验证且 orchestration 层强制 single-writer 时,才使用共享 RWX storage。 |
| 密钥 | 使用 container secret 或 credentials directory,不要使用公共文件。 |
Systemd 流程
fluxheim --config /etc/fluxheim/fluxheim.toml --check-config
sudo systemctl restart fluxheim
sudo systemctl status fluxheim
journalctl -u fluxheim -n 100 --no-pager
零停机升级
使用 systemd 套接字激活后,Fluxheim 在验证新进程并等待现有连接处理完成期间,仍可保持对外监听套接字可用。直接发布主机端口的容器无法在监听不中断的情况下替换,因此需要稳定的前置代理、负载均衡器或编排器。
阅读完整的升级规范生产检查清单
- 固定 release version 或 image digest。
- 以 read-only 挂载配置和内容。
- Keep ACME and cache state on persistent volumes.
- 按计划运行的 profile 验证配置。
- 变更流量前准备好 health checks 和 rollback commands。