shanshanzhong c381a2b2ba
Some checks failed
CI / build (20.15.1) (push) Failing after 15m20s
fix(docker): 修正Dockerfile中的用户创建命令和CI分支条件
修复Dockerfile中使用addgroup/adduser命令导致的兼容性问题,改用groupadd/useradd
修正CI配置中分支条件判断错误,将dev改为develop
2026-01-03 20:10:53 -08:00

24 lines
596 B
Docker

# Use the official lightweight Bun image
FROM oven/bun:latest AS base
# Set working directory
WORKDIR /app
# Create a non-root user for running the production application
RUN groupadd -r -g 1001 nodejs \
&& useradd -r -u 1001 -g nodejs nextjs
# Change to non-root user
USER nextjs
# Copy necessary files for production
COPY ./apps/admin/.next/standalone ./
COPY ./apps/admin/.next/static ./apps/admin/.next/static
COPY ./apps/admin/public ./apps/admin/public
# Disable Next.js telemetry at runtime
ENV NEXT_TELEMETRY_DISABLED=1
# Set default command
CMD ["bun", "apps/admin/server.js"]