forked from DevOps/deploy.stack
chore: add env.cfg.example templates and clean up config files
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
# Hindsight 部署栈
|
||||
# ============================================================
|
||||
# 部署前准备(仅首次):
|
||||
# mkdir -pv ${Volumes_Path}/{pgdata,backups,huggingface}
|
||||
# sudo chown -R 999:999 ${Volumes_Path}/pgdata
|
||||
# cp env.cfg.example env.cfg && $EDITOR env.cfg # 填入密码/API Key
|
||||
#
|
||||
# pull:: docker compose --env-file ./hindsight/env.cfg -f ./hindsight/stack.yml pull
|
||||
# RUN:: docker compose -p hindsight --env-file ./hindsight/env.cfg -f ./hindsight/stack.yml up -d
|
||||
# disc::
|
||||
# - DB 数据 bind 挂到 /home/geng/hindsight/pgdata(WSL 原生 fs,避 9P fsync 风险)
|
||||
# - 复用宿主 HF 缓存(bge + ms-marco 不重下)
|
||||
# - 镜像走南京大学 ghcr 镜像,国内拉得快
|
||||
# - 端口 8888=API, 9999=Admin UI, 5432=PostgreSQL,绑定 0.0.0.0 供 LAN VM 访问
|
||||
# ============================================================
|
||||
|
||||
services:
|
||||
db:
|
||||
image: ${HINDSIGHT_DB_IMAGE}:pg${HINDSIGHT_DB_VERSION:-18}
|
||||
container_name: hindsight-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- POSTGRES_USER=${HINDSIGHT_DB_USER:-hindsight_user}
|
||||
- POSTGRES_PASSWORD=${HINDSIGHT_DB_PASSWORD:?set HINDSIGHT_DB_PASSWORD}
|
||||
- POSTGRES_DB=${HINDSIGHT_DB_NAME:-hindsight_db}
|
||||
- POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD}
|
||||
- POSTGRES_INITDB_ARGS=--encoding=UTF8 --locale=C --auth-host=${POSTGRES_HOST_AUTH_METHOD}
|
||||
volumes:
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- ${Volumes_Path}/pgdata:/var/lib/postgresql/${HINDSIGHT_DB_VERSION:-18}/docker
|
||||
ports:
|
||||
- "${HINDSIGHT_DB_PORT:-5432}:5432"
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"pg_isready -U ${HINDSIGHT_DB_USER:-hindsight_user} -d ${HINDSIGHT_DB_NAME:-hindsight_db}",
|
||||
]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
networks:
|
||||
- hindsight-net
|
||||
|
||||
hindsight:
|
||||
image: ${HINDSIGHT_APP_IMAGE}:${HINDSIGHT_VERSION:-latest}
|
||||
container_name: hindsight-app
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "${HINDSIGHT_API_PORT:-8888}:8888"
|
||||
- "${HINDSIGHT_ADMIN_PORT:-9999}:9999"
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- HINDSIGHT_API_LLM_PROVIDER=${HINDSIGHT_API_LLM_PROVIDER}
|
||||
- HINDSIGHT_API_LLM_API_KEY=${HINDSIGHT_API_LLM_API_KEY:?set HINDSIGHT_API_LLM_API_KEY}
|
||||
- HINDSIGHT_API_LLM_MODEL=${HINDSIGHT_API_LLM_MODEL}
|
||||
- HINDSIGHT_API_LLM_BASE_URL=${HINDSIGHT_API_LLM_BASE_URL}
|
||||
- HINDSIGHT_API_DATABASE_URL=postgresql://${HINDSIGHT_DB_USER}:${HINDSIGHT_DB_PASSWORD}@db:5432/${HINDSIGHT_DB_NAME}
|
||||
- HINDSIGHT_API_LOG_LEVEL=${HINDSIGHT_API_LOG_LEVEL:-info}
|
||||
- HINDSIGHT_CP_DATAPLANE_API_URL=${HINDSIGHT_CP_DATAPLANE_API_URL}
|
||||
- HF_HUB_OFFLINE=1
|
||||
- TRANSFORMERS_OFFLINE=1
|
||||
volumes:
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- ${Volumes_Path}/backups:/home/hindsight/backups
|
||||
networks:
|
||||
- hindsight-net
|
||||
|
||||
networks:
|
||||
hindsight-net:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user