Files
MoShiro/packaging/compose/backend/compose.yaml
T
justme bac1c27e72
ci/woodpecker/push/main-amd64-build Pipeline was successful
fix: compose passes .env through env_file; clearer name and channel messages [CI]
podman-compose does not substitute defaults inside "environment:" (a value
like ${MOSHIRO_NAME:-} reached the node as the literal text), so the node was
enrolled with an invalid name and reported the wrong network scope. The three
compose files now read .env with env_file and only interpolate image and
network_mode; the Backend .env keys are the container's own names
(MoShiro__PublicUrl, MoShiro__ClaimCode).

- The generated .env no longer carries a comment line for MOSHIRO_NAME; the
  dialog says how to choose a name instead.
- The container entrypoint prints the name it enrolls with and defaults
  MOSHIRO_NETWORK_SCOPE to host (Docker Desktop sets container in .env).
- The overview and line pages say "measurement channel not established"
  instead of "not connected": the agent can be reachable and pingable while
  the measurement TCP/UDP path is not.
2026-10-08 20:47:38 +08:00

45 lines
2.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# MoShiro Backend(面板)。Docker 和 rootless/rootful Podman 共用。
#
# 用法:
# mkdir moshiro-backend && cd moshiro-backend
# 下载本文件为 compose.yaml;再写一个 .env,键是容器里直接用的名字:
# MoShiro__PublicUrl=https://panel.example.com # 面板对外的地址;passkey 绑定在这个域名上,改了会让已注册的 passkey 失效
# MoShiro__ClaimCode= # 认领码(可选),不写就随机生成并打印在日志里(podman logs moshiro-backend)
# (没有 .env 也要先建一个空文件:touch .env)
# podman compose up -d # Docker 用 docker compose
# 第一次打开面板按页面引导认领:没有默认管理员。面板监听 127.0.0.1:8080,对外请放在反向代理(HTTPS)后面。
# 更新:先备份数据卷,再 podman compose pull && podman compose up -d。新版会自动迁移数据库,
# 但旧版不认比自己新的数据库:想回滚要先恢复备份,只改 MOSHIRO_VERSION 不够。
# 说明见 docs/ops/deployment.md。
services:
backend:
image: ${MOSHIRO_IMAGE:-registry.oeo.one/moshiro/moshiro-backend}:${MOSHIRO_VERSION:-latest}
container_name: moshiro-backend
restart: unless-stopped
init: true
ports:
- "127.0.0.1:8080:8080"
# .env 里的变量原样传进容器(MoShiro__PublicUrl、MoShiro__ClaimCode 等)(不用带默认值的变量替换:有的 compose 提供者,比如 podman-compose,不替换环境变量里的默认值)
env_file:
- .env
environment:
ASPNETCORE_HTTP_PORTS: "8080"
MoShiro__DataDirectory: /data
volumes:
- moshiro-backend-data:/data
- moshiro-backend-status:/data/update-status:ro
read_only: true
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
stop_grace_period: 30s
volumes:
moshiro-backend-data:
name: moshiro-backend-data
moshiro-backend-status:
name: moshiro-backend-status