fix build

This commit is contained in:
sijinhui 2024-08-14 17:05:05 +08:00
parent 0bdabde514
commit 778c5bd4da
4 changed files with 22 additions and 16 deletions

View File

@ -17,6 +17,13 @@ jobs:
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }} 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 - name: Build and push Docker image
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
with: with:

View File

@ -6,7 +6,7 @@ COPY package.json yarn.lock ./
RUN yarn install RUN yarn install
FROM base AS builder FROM sijinhui/node:base AS builder
RUN apk add --no-cache git libc6-compat 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 ENV NEXT_SHARP_PATH /app/node_modules/sharp
RUN yarn build RUN yarn build
FROM base AS runner FROM sijinhui/node:base AS runner
WORKDIR /app WORKDIR /app
RUN apk add proxychains-ng RUN apk add proxychains-ng

View File

@ -1,17 +1,4 @@
FROM hub.si.icu/library/node:22.1-alpine AS base FROM sijinhui/node:base AS deps
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
WORKDIR /app WORKDIR /app

12
node.Dockerfile Normal file
View File

@ -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