feat: add mise base
This commit is contained in:
@@ -7,8 +7,10 @@ ENV PATH="/app/envs/mise/shims:/app/envs/mise/bin:$PATH"
|
|||||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
|
||||||
&& apk add --no-cache \
|
&& apk add --no-cache \
|
||||||
tzdata git bash curl wget vim htop ca-certificates rsync \
|
tzdata git bash curl wget vim htop ca-certificates rsync \
|
||||||
|
python3 \
|
||||||
# Python build dependencies
|
# Python build dependencies
|
||||||
build-base libffi-dev openssl-dev bzip2-dev zlib-dev readline-dev sqlite-dev ncurses-dev xz-dev \
|
build-base libffi-dev openssl-dev bzip2-dev zlib-dev readline-dev sqlite-dev ncurses-dev xz-dev \
|
||||||
|
&& ln -sf /usr/bin/python3 /usr/bin/python \
|
||||||
&& cp /usr/share/zoneinfo/${TZ} /etc/localtime \
|
&& cp /usr/share/zoneinfo/${TZ} /etc/localtime \
|
||||||
&& echo "${TZ}" > /etc/timezone \
|
&& echo "${TZ}" > /etc/timezone \
|
||||||
&& rm -rf /var/cache/apk/*
|
&& rm -rf /var/cache/apk/*
|
||||||
@@ -16,10 +18,10 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/re
|
|||||||
# 安装 mise
|
# 安装 mise
|
||||||
RUN curl https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh
|
RUN curl https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh
|
||||||
|
|
||||||
# 使用 mise 安装最新版本的 Node.js 和 Python
|
# 使用 mise 安装运行时
|
||||||
# 暂时安装到 /opt/mise-base,启动时会复制到 /app/envs/mise
|
|
||||||
ENV MISE_DATA_DIR=/opt/mise-base
|
ENV MISE_DATA_DIR=/opt/mise-base
|
||||||
ENV MISE_CONFIG_DIR=/opt/mise-base
|
ENV MISE_CONFIG_DIR=/opt/mise-base
|
||||||
ENV MISE_HTTP_TIMEOUT=300
|
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) \
|
ENV PYTHON_BUILD_MIRROR_URL=https://pyenv.pages.dev/api/mirror/binaries
|
||||||
|
RUN (mise use -g node@22 python@3.12 || mise use -g node@22 python@3.12) \
|
||||||
&& mise prune -- -f
|
&& mise prune -- -f
|
||||||
|
|||||||
@@ -19,10 +19,11 @@ RUN sed -i 's@deb.debian.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.li
|
|||||||
# 安装 mise
|
# 安装 mise
|
||||||
RUN curl https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh
|
RUN curl https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh
|
||||||
|
|
||||||
# 使用 mise 安装最新版本的 Node.js 和 Python
|
# 使用 mise 安装 Node.js 和 Python
|
||||||
# 暂时安装到 /opt/mise-base,启动时会复制到 /app/envs/mise
|
|
||||||
ENV MISE_DATA_DIR=/opt/mise-base
|
ENV MISE_DATA_DIR=/opt/mise-base
|
||||||
ENV MISE_CONFIG_DIR=/opt/mise-base
|
ENV MISE_CONFIG_DIR=/opt/mise-base
|
||||||
ENV MISE_HTTP_TIMEOUT=300
|
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) \
|
# 使用镜像源加速 Python 编译下载
|
||||||
|
ENV PYTHON_BUILD_MIRROR_URL=https://pyenv.pages.dev/api/mirror/binaries
|
||||||
|
RUN (mise use -g node@22 python@3.12 || mise use -g node@22 python@3.12) \
|
||||||
&& mise prune -- -f
|
&& mise prune -- -f
|
||||||
|
|||||||
@@ -11,18 +11,20 @@ RUN sed -i 's@deb.debian.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.li
|
|||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
tzdata git gcc curl wget vim htop ca-certificates rsync \
|
tzdata git gcc curl wget vim htop ca-certificates rsync \
|
||||||
|
python3-full \
|
||||||
build-essential libssl-dev zlib1g-dev libbz2-dev \
|
build-essential libssl-dev zlib1g-dev libbz2-dev \
|
||||||
libreadline-dev libsqlite3-dev libncursesw5-dev \
|
libreadline-dev libsqlite3-dev libncursesw5-dev \
|
||||||
xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
|
xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
|
||||||
|
&& ln -sf /usr/bin/python3 /usr/bin/python \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# 安装 mise
|
# 安装 mise
|
||||||
RUN curl https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh
|
RUN curl https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh
|
||||||
|
|
||||||
# 使用 mise 安装最新版本的 Node.js 和 Python
|
# 使用 mise 安装运行时
|
||||||
# 暂时安装到 /opt/mise-base,启动时会复制到 /app/envs/mise
|
|
||||||
ENV MISE_DATA_DIR=/opt/mise-base
|
ENV MISE_DATA_DIR=/opt/mise-base
|
||||||
ENV MISE_CONFIG_DIR=/opt/mise-base
|
ENV MISE_CONFIG_DIR=/opt/mise-base
|
||||||
ENV MISE_HTTP_TIMEOUT=300
|
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) \
|
ENV PYTHON_BUILD_MIRROR_URL=https://pyenv.pages.dev/api/mirror/binaries
|
||||||
|
RUN (mise use -g node@22 python@3.12 || mise use -g node@22 python@3.12) \
|
||||||
&& mise prune -- -f
|
&& mise prune -- -f
|
||||||
|
|||||||
Reference in New Issue
Block a user