Files
labmem 144b8abe49
Polaris CI / verify (push) Successful in 2m10s
Polaris CI / publish (push) Successful in 1m56s
ci(polaris): 增加镜像发布工作流
校验通过后构建、冒烟测试并推送镜像。
提供按摘要手动部署与回滚的 Compose 模板和说明。
2026-10-12 23:00:34 +08:00

40 lines
1.7 KiB
YAML
Raw Permalink 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.
# Polaris 独立 Compose 项目(第一阶段:宿主机手动发布)。
#
# 设计约束(详见 README.md):
# - 镜像由 .env 的 POLARIS_IMAGE 以 sha256 digest 固定,缺失时 compose 直接报错
# - 只加入外部网络 net-public(与 nginx 同网);不连 net-db
# - 不映射宿主机端口(无 ports:),仅经 nginx 反代访问
# - 无 DB/Redis、无 secrets、无源码/数据卷挂载
# - 应用在镜像内已是 node 非 root,监听 3000(见仓库 Dockerfile,本目录不改其行为)
# - HEALTHCHECK 用运行时 Node 原生 fetch 探测 /,不要求 curl 等额外工具
# - 顶层 name 固定项目名为 polaris,规避项目路径/命名歧义
name: polaris
services:
polaris:
# 必填:digest 固定的镜像引用;未设置时 compose 加载即失败并给出提示
image: ${POLARIS_IMAGE:?set POLARIS_IMAGE in .env, e.g. git.labmem.icu/<owner>/polaris@sha256:<digest> — see deploy/README.md}
container_name: polaris # net-public 内的 DNS 名,nginx 上游即 http://polaris:3000
restart: unless-stopped
# expose 仅作声明用途,不是端口映射;同网络容器本就可直接互访
expose:
- "3000"
healthcheck:
# 运行时镜像只有 node,不假设 curl:Node 22 自带全局 fetch
test:
- CMD
- node
- -e
- "fetch('http://127.0.0.1:3000/').then((r) => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
networks:
- net-public
networks:
net-public:
external: true # 由服务器既有栈提供;名字以 docker network ls 实际输出为准,勿在本文件创建