Files
deploy.stack/newapi/env.cfg.example
T

53 lines
2.0 KiB
Plaintext
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.
# ============================================================
# new-api 部署 — 环境变量模板(不含敏感信息)
# 复制为 env.cfg 后填入真实值,env.cfg 已在 .gitignore 中忽略
# ============================================================
#
# 使用方式:
# cp env.cfg.example env.cfg
# $EDITOR env.cfg # 填入真实密码/密钥后保存
# docker compose -p newapi --env-file ./env.cfg -f ./stack.yml up -d
#
# 说明:本栈为全容器化独立部署(new-api + Redis + PostgreSQL),
# 容器内 PostgreSQL 会自动初始化库和账号,无需在宿主机手动建库或配置 pg_hba。
# 容器 PG 未映射宿主机端口,不会与宿主机已有的 PostgreSQL 服务产生端口冲突。
#
# 注意:SQL_DSN / REDIS_CONN_STRING 为 URL 格式,
# 密码建议纯字母+数字,含 @ : / # 等字符时需做百分号转义
# ---------- 端口 ----------
# new-api Web 服务对外暴露端口
PORT=3000
# ---------- 镜像 ----------
# new-api 版本号(与 GitHub release tag 同名;拉取失败可回退 latest)
IMAGE_TAG_VER=v1.0.0-rc.30
# 完整镜像引用
IMAGE_TAG=calciumion/new-api:${IMAGE_TAG_VER}
# Redis 镜像
REDIS_IMAGE_TAG=redis:8.2
# PostgreSQL 镜像
PGSQL_IMAGE_TAG=postgres:16-alpine
# ---------- 数据卷 ----------
# 宿主机持久化目录,挂载到容器 /data、/app/logs、redis 数据以及 pgsql 数据
# 部署前手动创建:mkdir -pv /data/volumes/newapi/{data,logs,redis,pgsql_data}
Volumes_Path=/data/volumes/newapi
# ---------- 数据库(容器内 PostgreSQL----------
# 容器内网络互通,通过服务名 postgres 访问
DB_HOST=postgres
DB_PORT=5432
DB_NAME=new_api
DB_USER=newapi
DB_PASSWORD=<your-strong-password>
# ---------- Redis(容器内 Redis----------
REDIS_PASSWORD=<your-strong-password>
# ---------- new-api 应用 ----------
# 节点名,用于审计日志标识节点;多节点部署时各节点需不同
NODE_NAME=newapi-node-1
# 会话密钥:单机留空(自动生成并持久化);多机部署必须设为同一随机串
SESSION_SECRET=