快速入门
快速入门
快速入门
5 分钟,从零到运行中。
第一步:安装
# 一键安装平台组件
np install
# 或者安装 + 初始化项目
np install --init也可以直接下载二进制:
curl -Lo np https://github.com/np-run/np/releases/latest/download/np-linux-amd64
chmod +x np
sudo mv np /usr/local/bin/第二步:初始化
np init这会创建 np.yaml — 定义部署的单一文件:
# np.yaml
version: "1"
services:
- name: hello
type: container
source: nginx:alpine
port: 8080
domain: hello.my-app.com # 可选:自动生成 Traefik 路由
resources:
cpu: "100"
memory: "256"
replicas: 1第三步:部署
np deploy hello预演而不实际部署:
np deploy hello --dry-run第四步:查看状态
# 所有服务
np status
# 单个服务
np status hello第五步:扩缩容
np scale hello 3第六步:查看日志
# 快照
np logs hello
# 持续追踪
np logs --follow hello运行诊断
np doctorNext: 配置参考 →