diff --git a/.github/workflows/crontab_cache_to_dockerhub.yml b/.github/workflows/crontab_cache_to_dockerhub.yml index 76b5cee29..a0164149c 100644 --- a/.github/workflows/crontab_cache_to_dockerhub.yml +++ b/.github/workflows/crontab_cache_to_dockerhub.yml @@ -17,6 +17,13 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + file: node.Dockerfile + push: true + tags: sijinhui/node:base - name: Build and push Docker image uses: docker/build-push-action@v4 with: diff --git a/Dockerfile b/Dockerfile index 55d3c2413..33f6bb5ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ COPY package.json yarn.lock ./ RUN yarn install -FROM base AS builder +FROM sijinhui/node:base AS builder RUN apk add --no-cache git libc6-compat @@ -23,7 +23,7 @@ RUN mkdir -p "/app/node_modules/tiktoken" && mkdir -p "/app/node_modules/sharp" ENV NEXT_SHARP_PATH /app/node_modules/sharp RUN yarn build -FROM base AS runner +FROM sijinhui/node:base AS runner WORKDIR /app RUN apk add proxychains-ng diff --git a/cache.Dockerfile b/cache.Dockerfile index 93b11d64a..42e46d622 100644 --- a/cache.Dockerfile +++ b/cache.Dockerfile @@ -1,17 +1,4 @@ -FROM hub.si.icu/library/node:22.1-alpine AS base -RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories -RUN apk add --no-cache tzdata -# 设置时区环境变量 -ENV TZ=Asia/Chongqing -# 更新并安装时区工具 -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN yarn config set registry 'https://registry.npmmirror.com' ; \ - yarn config set sharp_binary_host "https://cdn.npmmirror.com/binaries/sharp" ; \ - yarn config set sharp_libvips_binary_host "https://cdn.npmmirror.com/binaries/sharp-libvips" -ENV PRISMA_ENGINES_MIRROR=https://registry.npmmirror.com/-/binary/prisma - -FROM base AS deps +FROM sijinhui/node:base AS deps WORKDIR /app diff --git a/node.Dockerfile b/node.Dockerfile new file mode 100644 index 000000000..fdfc81ba9 --- /dev/null +++ b/node.Dockerfile @@ -0,0 +1,12 @@ +FROM hub.si.icu/library/node:22.1-alpine AS base +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories +RUN apk add --no-cache tzdata +# 设置时区环境变量 +ENV TZ=Asia/Chongqing +# 更新并安装时区工具 +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN yarn config set registry 'https://registry.npmmirror.com' ; \ + yarn config set sharp_binary_host "https://cdn.npmmirror.com/binaries/sharp" ; \ + yarn config set sharp_libvips_binary_host "https://cdn.npmmirror.com/binaries/sharp-libvips" +ENV PRISMA_ENGINES_MIRROR=https://registry.npmmirror.com/-/binary/prisma