unis_manager/docker-compose.yml

43 lines
1.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 部门关键任务追踪看板 · 部署编排
#
# 常用命令(推荐用封装脚本,会顺带检查 docker/.env/data 目录并等健康检查):
# ./deploy.sh up 构建 + 后台启动
# ./deploy.sh update 改完代码重建并替换容器
# ./deploy.sh logs # 看日志
# ./deploy.sh down # 停止(数据留在 ./data)
#
# 等价的裸 compose 命令:docker compose up -d --build
services:
board:
build:
context: .
args:
# 传给 Dockerfile 的 pip 源,默认官方;国内网络可在 .env 里设
# PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
PIP_INDEX_URL: "${PIP_INDEX_URL:-https://pypi.org/simple}"
image: unis-board:latest
container_name: unis-board
restart: unless-stopped
# AI 整理参数、管理员账号等都来自 .env(compose 会自动读同目录的 .env 做变量替换)
env_file: .env
environment:
# 容器内端口固定 8770,跟 EXPOSE/健康检查对齐;要换对外端口请改 HOST_PORT
PORT: "8770"
# 容器里不开热加载(uvicorn --reload 会白耗 CPU,且代码在镜像内不可改)
DEV: "0"
# 覆盖宿主机的 TZ:周期/周次/入库时间都按这个时区计算
TZ: "${TZ:-Asia/Shanghai}"
ports:
- "${HOST_PORT:-8770}:8770"
volumes:
# SQLite 库、上传件、导出件都落在宿主机的 ./data,升级镜像不动数据
- ./data:/app/data
# Linux 上想让容器以普通用户跑(配合 ./data 的属主):
# user: "1000:1000"