feat: add minimal tag #57

This commit is contained in:
engigu
2026-03-16 09:28:20 +08:00
parent a19884541b
commit ba81d4edf2
6 changed files with 59 additions and 11 deletions
+18
View File
@@ -0,0 +1,18 @@
FROM debian:trixie-slim
ENV TZ=Asia/Shanghai
ENV MISE_DATA_DIR=/opt/mise-base
ENV MISE_CONFIG_DIR=/opt/mise-base
ENV PATH="/opt/mise-base/shims:/opt/mise-base/bin:$PATH"
# 安装必要系统工具并仅预装 mise
RUN sed -i 's@deb.debian.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources \
&& sed -i 's@security.debian.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources \
&& echo "${TZ}" > /etc/timezone \
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
tzdata git curl wget vim htop ca-certificates rsync \
&& curl https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /root/.cache/mise /opt/mise-base/cache/*
+7 -5
View File
@@ -41,8 +41,10 @@ export MISE_DATA_DIR="$MISE_DIR"
export MISE_CONFIG_DIR="$MISE_DIR"
export PATH="$MISE_DIR/shims:$MISE_DIR/bin:$PATH"
# 使 Node.js 运行脚本时能够自动找到全局安装的模块 (类似 Python site-packages 行为)
export NODE_PATH=$(npm root -g 2>/dev/null)
# 使 Node.js 运行脚本时能够自动找到全局安装的模块 (仅当 npm 存在时执行)
if command -v npm >/dev/null 2>&1; then
export NODE_PATH=$(npm root -g 2>/dev/null)
fi
# 默认启用 Python 镜像源
export PIP_INDEX_URL=${PIP_INDEX_URL:-https://pypi.org/simple}
@@ -55,9 +57,9 @@ export PYTHONPATH=/app/data/scripts:$PYTHONPATH
# 打印确认
# ============================
log "mise version: $(mise --version 2>/dev/null | head -n 1)"
log "python: $(python --version 2>&1 | head -n 1) at $(which python)"
log "node: $(node --version 2>&1 | head -n 1) at $(which node)"
log "npm: $(npm --version 2>&1 | head -n 1) at $(which npm)"
[ -x "$(command -v python)" ] && log "python: $(python --version 2>&1 | head -n 1) at $(which python)" || log "python: not installed"
[ -x "$(command -v node)" ] && log "node: $(node --version 2>&1 | head -n 1) at $(which node)" || log "node: not installed"
[ -x "$(command -v npm)" ] && log "npm: $(npm --version 2>&1 | head -n 1) at $(which npm)" || log "npm: not installed"
# ============================
# 将 baihu 注册到全局命令