#!/bin/sh # 容器入口: 数据卷为空时自动建库并导入 254 套样板, 之后交给 CMD 启动服务 set -e DB_FILE="/app/db/huamenchuang.db" export PATH="/app/.venv/bin:$PATH" mkdir -p /app/db if [ ! -f "$DB_FILE" ]; then echo "[entrypoint] 首次启动: 初始化数据库并导入样板数据..." python -m huamenchuang.scripts.seed echo "[entrypoint] 种子完成: 管理员 13800000000/123456" fi exec "$@"