From 042b24b0ed7baa322cd4450de655a1c32b480389 Mon Sep 17 00:00:00 2001 From: cat-shark <1716967236@qq.com> Date: Sun, 19 Jul 2026 18:54:03 +0800 Subject: [PATCH] add Dockerfile for Node.js/TS AI service --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c763fe7 --- /dev/null +++ b/Dockerfile @@ -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"]