This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -9,7 +9,9 @@ COPY package.json pnpm-lock.yaml ./
|
||||
# 设置 npm registry 为 npmmirror 镜像源
|
||||
RUN npm config set registry https://registry.npmmirror.com
|
||||
RUN npm install -g pnpm
|
||||
RUN pnpm install --frozen-lockfile
|
||||
# 清理 pnpm store 并安装依赖
|
||||
RUN pnpm store prune || true
|
||||
RUN pnpm install --frozen-lockfile --strict-peer-dependencies=false
|
||||
|
||||
# Rebuild the source code only when needed
|
||||
FROM hub.diyla.com/node:${NODE_IMAGE_VERSION} AS builder
|
||||
@@ -26,6 +28,8 @@ ENV DATABASE_URL="postgresql://user:pass@localhost:5432/dummy"
|
||||
|
||||
# 设置 npm registry 为 npmmirror 镜像源
|
||||
RUN npm config set registry https://registry.npmmirror.com
|
||||
# 设置 pnpm 配置
|
||||
RUN pnpm config set registry https://registry.npmmirror.com || true
|
||||
RUN npm run build-docker
|
||||
|
||||
# Production image, copy all the files and run next
|
||||
@@ -49,10 +53,13 @@ RUN set -x \
|
||||
&& apk add --no-cache curl \
|
||||
&& npm install -g pnpm
|
||||
|
||||
# 设置 pnpm 配置
|
||||
RUN pnpm config set registry https://registry.npmmirror.com || true
|
||||
|
||||
# Script dependencies
|
||||
RUN pnpm --allow-build='@prisma/engines' add npm-run-all dotenv chalk semver \
|
||||
prisma@${PRISMA_VERSION} \
|
||||
@prisma/adapter-pg@${PRISMA_VERSION}
|
||||
@prisma/adapter-pg@${PRISMA_VERSION} --strict-peer-dependencies=false
|
||||
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
|
||||
Reference in New Issue
Block a user