feat: improve database module and apply untranslated color to UI

This commit is contained in:
2026-04-13 01:01:52 +08:00
parent 250abaa453
commit 12282ae4b3
3 changed files with 95 additions and 176 deletions
+23 -10
View File
@@ -4,16 +4,20 @@ FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
# 国内镜像加速
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
COPY package.json pnpm-lock.yaml ./
# Install dependencies
RUN corepack enable && pnpm install --frozen-lockfile
# 国内源 + 快速启用 pnpm
RUN corepack enable && \
npm config set registry https://registry.npmmirror.com && \
pnpm config set registry https://registry.npmmirror.com
RUN pnpm install --frozen-lockfile
# Copy source code
COPY . .
# Build the application
RUN pnpm build
# Stage 2: Runner
@@ -23,21 +27,30 @@ WORKDIR /app
ENV NODE_ENV=production
# Create non-root user
# 国内镜像
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# 创建用户
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs
# Copy built application
# 复制构建产物
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
# Set ownership
# ===================== 修复权限错误 =====================
# 复制项目根目录的配置文件
COPY --from=builder /app/config.json ./
# 给 nextjs 用户授权整个目录
RUN chown -R nextjs:nodejs /app
# ========================================================
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]
CMD ["node", "server.js"]