feat: 增加mirror,提高编译速度
Some checks failed
Branch Build CE / Build Setup (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Codespell / Check for spelling errors (push) Has been cancelled
Sync Repositories / sync_changes (push) Has been cancelled
Branch Build CE / Build-Push Admin Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Web Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Space Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Live Collaboration Docker Image (push) Has been cancelled
Branch Build CE / Build-Push API Server Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Proxy Docker Image (push) Has been cancelled
Branch Build CE / Build-Push AIO Docker Image (push) Has been cancelled
Branch Build CE / Upload Build Assets (push) Has been cancelled
Branch Build CE / Build Release (push) Has been cancelled
Some checks failed
Branch Build CE / Build Setup (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Codespell / Check for spelling errors (push) Has been cancelled
Sync Repositories / sync_changes (push) Has been cancelled
Branch Build CE / Build-Push Admin Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Web Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Space Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Live Collaboration Docker Image (push) Has been cancelled
Branch Build CE / Build-Push API Server Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Proxy Docker Image (push) Has been cancelled
Branch Build CE / Build-Push AIO Docker Image (push) Has been cancelled
Branch Build CE / Upload Build Assets (push) Has been cancelled
Branch Build CE / Build Release (push) Has been cancelled
This commit is contained in:
3
.npmrc
3
.npmrc
@@ -32,3 +32,6 @@ prefer-offline=true
|
||||
|
||||
# Ensure workspace protocol is used when adding internal deps
|
||||
save-workspace-protocol=true
|
||||
|
||||
# Configure Chinese mirrors for faster downloads in China
|
||||
registry=https://registry.npmmirror.com
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
FROM node:22-alpine AS base
|
||||
|
||||
# Configure Chinese mirrors for npm/pnpm
|
||||
ENV npm_config_registry=https://registry.npmmirror.com
|
||||
ENV PNPM_REGISTRY=https://registry.npmmirror.com
|
||||
|
||||
# Configure Chinese mirrors for apk
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV TURBO_TELEMETRY_DISABLED=1
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
FROM node:22-alpine
|
||||
|
||||
# Configure Chinese mirrors for npm/pnpm
|
||||
ENV npm_config_registry=https://registry.npmmirror.com
|
||||
ENV PNPM_REGISTRY=https://registry.npmmirror.com
|
||||
|
||||
# Configure Chinese mirrors for apk
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
RUN apk add --no-cache libc6-compat
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
@@ -6,6 +6,13 @@ ENV PYTHONUNBUFFERED=1
|
||||
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||
ENV INSTANCE_CHANGELOG_URL=https://sites.plane.so/pages/691ef037bcfe416a902e48cb55f59891/
|
||||
|
||||
# Configure Chinese mirrors for pip
|
||||
ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple/
|
||||
ENV PIP_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn
|
||||
|
||||
# Configure Chinese mirrors for apk
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
# Update system packages for security
|
||||
RUN apk update && apk upgrade
|
||||
|
||||
@@ -19,6 +26,7 @@ RUN apk add --no-cache --upgrade \
|
||||
"openssl"
|
||||
|
||||
COPY requirements.txt ./
|
||||
COPY pip.conf /etc/pip.conf
|
||||
COPY requirements ./requirements
|
||||
RUN apk add --no-cache libffi-dev
|
||||
RUN apk add --no-cache --virtual .build-deps \
|
||||
|
||||
@@ -6,6 +6,13 @@ ENV PYTHONUNBUFFERED 1
|
||||
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||
ENV INSTANCE_CHANGELOG_URL https://sites.plane.so/pages/691ef037bcfe416a902e48cb55f59891/
|
||||
|
||||
# Configure Chinese mirrors for pip
|
||||
ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple/
|
||||
ENV PIP_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn
|
||||
|
||||
# Configure Chinese mirrors for apk
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
RUN apk --no-cache add \
|
||||
"bash~=5.2" \
|
||||
"libpq" \
|
||||
@@ -26,6 +33,7 @@ RUN apk --no-cache add \
|
||||
WORKDIR /code
|
||||
|
||||
COPY requirements.txt ./requirements.txt
|
||||
COPY pip.conf /etc/pip.conf
|
||||
ADD requirements ./requirements
|
||||
|
||||
# Install the local development settings
|
||||
|
||||
6
apps/api/pip.conf
Normal file
6
apps/api/pip.conf
Normal file
@@ -0,0 +1,6 @@
|
||||
[global]
|
||||
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
|
||||
trusted-host = pypi.tuna.tsinghua.edu.cn
|
||||
|
||||
[install]
|
||||
trusted-host = pypi.tuna.tsinghua.edu.cn
|
||||
@@ -1,5 +1,12 @@
|
||||
FROM node:22-alpine
|
||||
|
||||
# Configure Chinese mirrors for npm/pnpm
|
||||
ENV npm_config_registry=https://registry.npmmirror.com
|
||||
ENV PNPM_REGISTRY=https://registry.npmmirror.com
|
||||
|
||||
# Configure Chinese mirrors for apk
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
FROM node:22-alpine AS base
|
||||
|
||||
# Configure Chinese mirrors for npm/pnpm
|
||||
ENV npm_config_registry=https://registry.npmmirror.com
|
||||
ENV PNPM_REGISTRY=https://registry.npmmirror.com
|
||||
|
||||
# Configure Chinese mirrors for apk
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
# Setup pnpm package manager with corepack and configure global bin directory for caching
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
FROM caddy:2.10.0-builder-alpine AS caddy-builder
|
||||
|
||||
# Configure Chinese mirrors for apk
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
RUN xcaddy build \
|
||||
--with github.com/caddy-dns/cloudflare@v0.2.1 \
|
||||
--with github.com/caddy-dns/digitalocean@04bde2867106aa1b44c2f9da41a285fa02e629c5 \
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
FROM node:22-alpine
|
||||
|
||||
# Configure Chinese mirrors for npm/pnpm
|
||||
ENV npm_config_registry=https://registry.npmmirror.com
|
||||
ENV PNPM_REGISTRY=https://registry.npmmirror.com
|
||||
|
||||
# Configure Chinese mirrors for apk
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
RUN apk add --no-cache libc6-compat
|
||||
|
||||
# Set working directory
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
FROM node:22-alpine AS base
|
||||
|
||||
# Configure Chinese mirrors for npm/pnpm
|
||||
ENV npm_config_registry=https://registry.npmmirror.com
|
||||
ENV PNPM_REGISTRY=https://registry.npmmirror.com
|
||||
|
||||
# Configure Chinese mirrors for apk
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV TURBO_TELEMETRY_DISABLED=1
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
FROM node:22-alpine
|
||||
|
||||
# Configure Chinese mirrors for npm/pnpm
|
||||
ENV npm_config_registry=https://registry.npmmirror.com
|
||||
ENV PNPM_REGISTRY=https://registry.npmmirror.com
|
||||
|
||||
# Configure Chinese mirrors for apk
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
RUN apk add --no-cache libc6-compat
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
FROM node:22-alpine AS base
|
||||
|
||||
# Configure Chinese mirrors for npm/pnpm
|
||||
ENV npm_config_registry=https://registry.npmmirror.com
|
||||
ENV PNPM_REGISTRY=https://registry.npmmirror.com
|
||||
|
||||
# Configure Chinese mirrors for apk
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
# Setup pnpm package manager with corepack and configure global bin directory for caching
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
|
||||
56
docs/wsl2-docker-credential-issue.md
Normal file
56
docs/wsl2-docker-credential-issue.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# WSL2 Docker 凭证错误修复
|
||||
|
||||
## 错误现象
|
||||
|
||||
```bash
|
||||
docker compose -f docker-compose-local.yml up -d
|
||||
```
|
||||
|
||||
构建失败,报错:
|
||||
|
||||
```
|
||||
error getting credentials - err: fork/exec /usr/bin/docker-credential-desktop.exe: exec format error
|
||||
```
|
||||
|
||||
## 根本原因
|
||||
|
||||
Docker Desktop 在 Windows 上安装后,会在 `~/.docker/config.json` 中配置 Windows 凭证助手:
|
||||
|
||||
```json
|
||||
{
|
||||
"credsStore": "desktop.exe"
|
||||
}
|
||||
```
|
||||
|
||||
WSL2 是 Linux 环境,无法执行 `.exe` 文件,导致 Docker 在拉取镜像时尝试调用凭证助手失败。
|
||||
|
||||
## 解决方案
|
||||
|
||||
编辑 `~/.docker/config.json`,禁用凭证存储:
|
||||
|
||||
```json
|
||||
{
|
||||
"auths": {},
|
||||
"credsStore": ""
|
||||
}
|
||||
```
|
||||
|
||||
或直接执行:
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.docker
|
||||
cat > ~/.docker/config.json << 'EOF'
|
||||
{
|
||||
"auths": {},
|
||||
"credsStore": ""
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
## 验证
|
||||
|
||||
重新运行 Docker Compose,镜像拉取和构建正常进行:
|
||||
|
||||
```bash
|
||||
docker compose -f docker-compose-local.yml up -d
|
||||
```
|
||||
4
setup.sh
4
setup.sh
@@ -77,6 +77,10 @@ else
|
||||
success=false
|
||||
fi
|
||||
|
||||
# Configure Chinese mirrors for npm/pnpm before installation
|
||||
export npm_config_registry=https://registry.npmmirror.com
|
||||
export PNPM_REGISTRY=https://registry.npmmirror.com
|
||||
|
||||
# Activate pnpm (version set in package.json)
|
||||
corepack enable pnpm || success=false
|
||||
# Install Node dependencies
|
||||
|
||||
Reference in New Issue
Block a user