Skip to content

Commit b3db1a0

Browse files
committed
add back dockerfile
1 parent 24e0bde commit b3db1a0

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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"]

0 commit comments

Comments
 (0)