File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ # ----- Build Stage -----
2+ FROM node:lts-alpine AS builder
3+ WORKDIR /app
4+
5+ # Copy package files first for dependency caching
6+ COPY package.json pnpm-lock.yaml ./
7+ RUN corepack enable && pnpm install --frozen-lockfile
8+
9+ # Copy configuration and source code
10+ COPY tsconfig.json ./
11+ COPY src ./src
12+ COPY config.d.ts index.d.ts ./
13+
14+ # Build the application
15+ RUN pnpm build
16+
17+ # ----- Production Stage -----
18+ FROM node:lts-alpine
19+ WORKDIR /app
20+
21+ # Copy package files and install production dependencies
22+ COPY package.json pnpm-lock.yaml ./
23+ RUN corepack enable && pnpm install --prod --frozen-lockfile --ignore-scripts
24+
25+ # Copy built artifacts and required files
26+ COPY --from=builder /app/dist ./dist
27+ COPY index.js config.d.ts index.d.ts cli.js ./
28+
29+ # Expose HTTP port
30+ EXPOSE 8080
31+
32+ # Default command using CLI flags
33+ CMD ["node" , "cli.js" , "--port" , "8080" ]
You can’t perform that action at this time.
0 commit comments