mirror of
https://github.com/Moe-Sakura/Wrangler-API.git
synced 2026-03-16 04:23:17 +08:00
- 将基础镜像从 node:20-alpine 切换为 bookworm-slim。 - 在 Dockerfile 中配置阿里云 APT 镜像源并安装证书。 - 修改 npm ci 命令以包含可选依赖项。 - 同步更新 README.md 中的 Docker 镜像标签名称。
24 lines
930 B
Docker
24 lines
930 B
Docker
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 --include=optional
|
|
|
|
COPY . .
|
|
|
|
EXPOSE 8787
|
|
|
|
CMD ["npx", "wrangler", "dev", "--local", "--ip", "0.0.0.0", "--port", "8787"]
|