优化后端构建方式,修改首页报表 bug

This commit is contained in:
eafonyang
2026-07-30 15:08:05 +08:00
parent f2bbaa6876
commit b1c88fc5e6
12 changed files with 56 additions and 54 deletions
+6 -13
View File
@@ -11,22 +11,15 @@ WORKDIR /app
# Create logs directory
RUN mkdir -p /app/logs
# Install dependencies (including devDependencies for build)
COPY package.json pnpm-lock.yaml ./
RUN corepack enable pnpm && pnpm install --frozen-lockfile
# Install production dependencies only
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN corepack enable pnpm && pnpm install --frozen-lockfile --prod
# Copy application code
COPY tsconfig.json drizzle.config.ts ./
COPY src/ ./src/
# Build TypeScript → dist/
RUN pnpm build
# Remove devDependencies after build
RUN pnpm prune --prod
# Copy pre-built application
COPY dist/ ./dist/
# Expose port
EXPOSE 8000
# Run the compiled application
CMD ["node", "--conditions", "@zod/source", "dist/app.js"]
CMD ["node", "dist/app.js"]