mirror of
https://github.com/Moe-Sakura/Wrangler-API.git
synced 2026-03-15 04:13:18 +08:00
build: 更新 Docker 基础镜像并优化构建配置
- 将基础镜像从 node:20-alpine 切换为 bookworm-slim。 - 在 Dockerfile 中配置阿里云 APT 镜像源并安装证书。 - 修改 npm ci 命令以包含可选依赖项。 - 同步更新 README.md 中的 Docker 镜像标签名称。
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,9 +1,20 @@
|
||||
FROM node:20-alpine
|
||||
FROM node:20-bookworm-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN if [ -f /etc/apt/sources.list ]; then \
|
||||
sed -i 's|http://deb.debian.org/debian|http://mirrors.aliyun.com/debian|g' /etc/apt/sources.list; \
|
||||
sed -i 's|http://security.debian.org/debian-security|http://mirrors.aliyun.com/debian-security|g' /etc/apt/sources.list || true; \
|
||||
elif [ -f /etc/apt/sources.list.d/debian.sources ]; then \
|
||||
sed -i 's|http://deb.debian.org/debian|http://mirrors.aliyun.com/debian|g' /etc/apt/sources.list.d/debian.sources; \
|
||||
sed -i 's|http://security.debian.org/debian-security|http://mirrors.aliyun.com/debian-security|g' /etc/apt/sources.list.d/debian.sources || true; \
|
||||
fi \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
RUN npm ci --include=optional
|
||||
|
||||
COPY . .
|
||||
|
||||
|
||||
Reference in New Issue
Block a user