feat: smaller imaege szie

This commit is contained in:
engigu
2026-02-12 17:27:23 +08:00
parent e37d806141
commit 81dfbbf0e3
5 changed files with 75 additions and 73 deletions
+10 -15
View File
@@ -7,21 +7,16 @@ 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 \
&& apk add --no-cache \
tzdata git bash curl wget vim htop ca-certificates rsync \
python3 \
# Python build dependencies
build-base libffi-dev openssl-dev bzip2-dev zlib-dev readline-dev sqlite-dev ncurses-dev xz-dev \
&& BUILD_DEPS="build-base libffi-dev openssl-dev bzip2-dev zlib-dev readline-dev sqlite-dev ncurses-dev xz-dev" \
&& apk add --no-cache $BUILD_DEPS \
&& curl https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh \
&& MISE_DATA_DIR=/opt/mise-base MISE_CONFIG_DIR=/opt/mise-base MISE_HTTP_TIMEOUT=300 \
PYTHON_BUILD_MIRROR_URL=https://pyenv.pages.dev/api/mirror/binaries \
(mise use -g node@22 python@3.12 || mise use -g node@22 python@3.12) \
&& mise prune -- -f \
&& apk del $BUILD_DEPS \
&& ln -sf /usr/bin/python3 /usr/bin/python \
&& 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 安装运行时
ENV MISE_DATA_DIR=/opt/mise-base
ENV MISE_CONFIG_DIR=/opt/mise-base
ENV MISE_HTTP_TIMEOUT=300
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
&& rm -rf /var/cache/apk/* \
&& rm -rf /root/.cache/mise /root/.cache/pip /opt/mise-base/cache/*