feat: 新增 node 示例(Node 22 内置 http Web,两阶段构建)

This commit is contained in:
2026-11-15 11:21:26 +08:00
parent 0417a0fd90
commit 69f5c17f90
10 changed files with 276 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
version: '3.8'
networks:
node-demo:
ipam:
driver: default
config:
- subnet: "172.31.1.0/24"
services:
demo:
image: registry.cn-shanghai.aliyuncs.com/odboy/kenaito:demo-node # 镜像由 build.sh 构建
container_name: node-demo
restart: unless-stopped
ports: # 映射端口
- "8087:8087"
environment: # 设置环境变量,相当于docker run命令中的-e
TZ: Asia/Shanghai
APP_PORT: "8087"
NODE_ENV: production
healthcheck:
# 运行镜像自带 net-tools,直接用端口探测,不额外安装 curl
test: ["CMD-SHELL", "netstat -tln | grep -q ':8087 '"]
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
networks:
node-demo:
ipv4_address: 172.31.1.20