-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.agent
More file actions
31 lines (26 loc) · 873 Bytes
/
Dockerfile.agent
File metadata and controls
31 lines (26 loc) · 873 Bytes
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
# syntax=docker/dockerfile:1
FROM node:20 AS base
WORKDIR /workspace
RUN corepack enable && corepack prepare pnpm@10.18.0 --activate
FROM base AS deps
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY agent/package.json agent/package.json
RUN pnpm install --filter agent... --frozen-lockfile
FROM deps AS build
COPY tsconfig.base.json ./
COPY agent ./agent
RUN pnpm --filter agent build
FROM node:20 AS runner
WORKDIR /workspace
RUN corepack enable && corepack prepare pnpm@10.18.0 --activate
ENV NODE_ENV=production
ENV PORT=4001
COPY pnpm-workspace.yaml ./
COPY package.json ./
COPY agent/package.json ./agent/
COPY --from=deps /workspace/node_modules ./node_modules
COPY --from=deps /workspace/agent/node_modules ./agent/node_modules
COPY --from=build /workspace/agent/dist ./agent/dist
EXPOSE 4001
WORKDIR /workspace/agent
CMD ["node", "dist/index.js"]