feat: add mise base

This commit is contained in:
engigu
2026-02-12 12:10:44 +08:00
parent 5e1ea6b93f
commit be6a490a19
8 changed files with 87 additions and 77 deletions
+16 -15
View File
@@ -1,24 +1,25 @@
FROM alpine:3.19
ENV TZ=Asia/Shanghai
ENV PATH="/app/envs/node/bin:/app/envs/python/bin:$PATH"
ENV NODE_PATH="/app/envs/node/lib/node_modules"
ENV PATH="/app/envs/mise/shims:/app/envs/mise/bin:$PATH"
# 安装必要系统工具 + Node + Python
# 安装必要系统工具
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
&& apk add --no-cache \
tzdata \
git \
gcc \
musl-dev \
curl \
wget \
vim \
nodejs \
npm \
python3 \
py3-pip \
htop \
tzdata git bash curl wget vim htop ca-certificates rsync \
# Python build dependencies
build-base libffi-dev openssl-dev bzip2-dev zlib-dev readline-dev sqlite-dev ncurses-dev xz-dev \
&& cp /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo "${TZ}" > /etc/timezone \
&& rm -rf /var/cache/apk/*
# 安装 mise
RUN curl https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh
# 使用 mise 安装最新版本的 Node.js 和 Python
# 暂时安装到 /opt/mise-base,启动时会复制到 /app/envs/mise
ENV MISE_DATA_DIR=/opt/mise-base
ENV MISE_CONFIG_DIR=/opt/mise-base
ENV MISE_HTTP_TIMEOUT=300
RUN (mise use -g node@latest python@latest || mise use -g node@latest python@latest || mise use -g node@latest python@latest) \
&& mise prune -- -f