Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (42 loc) · 1.65 KB
/
Copy pathDockerfile
File metadata and controls
45 lines (42 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# syntax=docker/dockerfile:1.7
FROM node:22-bookworm-slim@sha256:83f487e0a63425e5b4d146fb5e5be574bcbe1b7b843d3ebafdd95eaf7767a7e5 AS build
WORKDIR /app
COPY package.json package-lock.json tsconfig.json .intentignore ./
RUN npm ci --include=dev
COPY src ./src
COPY sdk/typescript/src ./sdk/typescript/src
COPY test ./test
COPY python ./python
COPY golang ./golang
COPY java ./java
COPY rust-ast ./rust-ast
COPY prompts ./prompts
COPY schemas ./schemas
COPY scripts ./scripts
RUN npm run build && npm prune --omit=dev --omit=optional
FROM node:22-bookworm-slim@sha256:83f487e0a63425e5b4d146fb5e5be574bcbe1b7b843d3ebafdd95eaf7767a7e5 AS runtime
RUN apt-get update \
&& apt-get install -y --no-install-recommends git python3 ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
ENV NODE_ENV=production \
T2C_ROOT=/workspace
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
COPY package.json LICENSE .env.example .intentignore ./
# The runtime image ships git and python3. Go, Java and Rust adapters degrade to
# explicit warnings when matching sources exist; install their toolchains in a
# derived image to enable them.
COPY python ./python
COPY golang ./golang
COPY java ./java
COPY rust-ast ./rust-ast
COPY adapters/tensorflow/package*.json ./adapters/tensorflow/
COPY prompts ./prompts
COPY schemas ./schemas
RUN mkdir -p /workspace && chown -R node:node /app /workspace
USER node
EXPOSE 8787
HEALTHCHECK --interval=15s --timeout=3s --start-period=10s --retries=3 \
CMD node -e "fetch('http://127.0.0.1:8787/healthz').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"
CMD ["node", "dist/src/interfaces/a2a.js"]