29 lines
598 B
Docker
29 lines
598 B
Docker
# monitor-ai Dockerfile
|
|
FROM node:22-alpine AS base
|
|
WORKDIR /app
|
|
|
|
# 1. 依赖安装
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --production=false
|
|
|
|
# 2. 复制共享库
|
|
COPY ../shared/ ./shared/
|
|
|
|
# 3. 复制源码并构建
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# 4. 生产镜像
|
|
FROM node:22-alpine AS runner
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
COPY --from=base /app/.next/standalone ./
|
|
COPY --from=base /app/.next/static ./.next/static
|
|
COPY --from=base /app/scripts ./scripts
|
|
COPY --from=base /app/shared ./shared
|
|
COPY entrypoint.sh ./
|
|
|
|
RUN npm install -g tsx
|
|
EXPOSE 6181
|
|
CMD ["sh", "entrypoint.sh"]
|