add Dockerfile for Node.js/TS AI service

This commit is contained in:
2026-07-19 18:54:03 +08:00
parent 3611054587
commit 042b24b0ed
+18
View File
@@ -0,0 +1,18 @@
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY tsconfig.json ./
COPY src/ ./src/
RUN npx tsc
FROM node:20-alpine AS runner
WORKDIR /app
RUN apk add --no-cache curl
COPY --from=builder /app/dist ./dist
COPY package*.json ./
RUN npm ci --omit=dev --ignore-scripts
EXPOSE 5199
HEALTHCHECK --interval=10s --timeout=5s --start-period=10s --retries=3 \
CMD curl --fail http://localhost:5199/health || exit 1
CMD ["node", "dist/index.js"]