Files
TaskPool/docker-entrypoint.sh
T

34 lines
736 B
Bash
Raw Normal View History

2025-12-21 10:23:25 +08:00
#!/bin/sh
2025-12-23 11:07:59 +08:00
# ============================
# 激活 Python 虚拟环境
# ============================
if [ -d /opt/venv ]; then
export PATH="/opt/venv/bin:$PATH"
fi
# ============================
# 创建必要目录
# ============================
2025-12-21 10:23:25 +08:00
mkdir -p /app/data /app/data/scripts /app/configs
2025-12-23 11:07:59 +08:00
# ============================
# 设置不可变属性
# ============================
2025-12-21 10:23:25 +08:00
if [ -f /app/data/ql.db ]; then
chattr +i /app/data/ql.db 2>/dev/null || true
fi
if [ -d /app/configs ]; then
chattr +i /app/configs 2>/dev/null || true
fi
if [ -d /app/data/scripts ]; then
chattr +i /app/data/scripts 2>/dev/null || true
fi
2025-12-23 11:07:59 +08:00
# ============================
2025-12-21 10:23:25 +08:00
# 启动应用
2025-12-23 11:07:59 +08:00
# ============================
2025-12-21 10:23:25 +08:00
exec ./baihu