Commit dd53c6c2 by luoqi

chore(env): drop root .env.example; clarify per-mode usage

- 删根 .env.example(误导:实际只在 docker-compose.prod.yml 模式被读取)
- README quick-start 改为从 apps/*/.env.example 复制(本地 dev 标准做法)
- docker-compose.prod.yml 顶部加注释列出它依赖的 root .env keys

之后两种模式职责清晰:
  systemd 模式 → apps/pac-service/.env + apps/pac-web/.env(唯一真相)
  compose 模式 → 根 .env(用户自己按 prod.yml 注释组装)
parent 4a766e66
# --- Database ---
DATABASE_URL=postgresql://pac:pac@localhost:5532/pac?schema=public
# --- Redis ---
REDIS_URL=redis://localhost:6479
# --- JWT ---
JWT_SECRET=replace-with-strong-random-secret-min-32-chars
JWT_REFRESH_SECRET=replace-with-another-strong-secret-min-32-chars
JWT_EXPIRES_IN=2h
JWT_REFRESH_EXPIRES_IN=7d
# --- AI Gateway ---
# The gateway is a passthrough that mirrors the Dify API shape
# (POST /workflows/run + /workflows/run with stream).
AI_GATEWAY_URL=https://ai-gateway.example.com
AI_GATEWAY_API_KEY=
# --- Service ---
NODE_ENV=development
PORT=3101
LOG_LEVEL=info
CORS_ORIGINS=http://localhost:3100
# --- One-time code ---
EXCHANGE_CODE_TTL_SECONDS=60
# --- Frontend ---
NEXT_PUBLIC_API_BASE_URL=http://localhost:3101
...@@ -45,8 +45,9 @@ Adapters (sync engine): ...@@ -45,8 +45,9 @@ Adapters (sync engine):
# 1. install # 1. install
pnpm install pnpm install
# 2. start postgres + redis (and optionally the apps) # 2. start postgres + redis (apps will pick up apps/*/.env automatically)
cp .env.example .env cp apps/pac-service/.env.example apps/pac-service/.env
cp apps/pac-web/.env.example apps/pac-web/.env
docker compose up -d postgres redis docker compose up -d postgres redis
# 3. run the database migration + seed the demo platform # 3. run the database migration + seed the demo platform
......
# Requires a root `.env` next to this file. Keys it needs:
# POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DB
# DATABASE_URL / REDIS_URL
# JWT_SECRET / JWT_REFRESH_SECRET / JWT_EXPIRES_IN / JWT_REFRESH_EXPIRES_IN
# AI_GATEWAY_URL / AI_GATEWAY_API_KEY
# CORS_ORIGINS / EXCHANGE_CODE_TTL_SECONDS
# NEXT_PUBLIC_API_BASE_URL (build-time, change → rebuild web)
# Per-key meaning: see apps/pac-service/.env.example (most overlap).
# Run: docker compose -f docker-compose.prod.yml up -d --build
services: services:
postgres: postgres:
image: postgres:16-alpine image: postgres:16-alpine
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment