-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.web
More file actions
50 lines (46 loc) · 2.39 KB
/
Copy pathDockerfile.web
File metadata and controls
50 lines (46 loc) · 2.39 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
46
47
48
49
50
FROM node:24.17.0-alpine@sha256:156b55f92e98ccd5ef49578a8cea0df4679826564bad1c9d4ef04462b9f0ded6 AS toolchain
WORKDIR /app
RUN test "$(corepack --version)" = "0.35.0" \
&& corepack enable \
&& corepack prepare pnpm@11.11.0 --activate \
&& test "$(pnpm --version)" = "11.11.0"
FROM toolchain AS deps
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.json tsconfig.base.json vitest.config.ts ./
COPY apps/web/package.json apps/web/package.json
COPY apps/runner/package.json apps/runner/package.json
COPY packages/core/package.json packages/core/package.json
COPY packages/pi-engine/package.json packages/pi-engine/package.json
RUN pnpm install --frozen-lockfile
FROM deps AS build
COPY . .
RUN pnpm build
FROM toolchain AS prod-deps
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY apps/web/package.json apps/web/package.json
COPY packages/core/package.json packages/core/package.json
RUN pnpm install --prod --frozen-lockfile
FROM node:24.17.0-alpine@sha256:156b55f92e98ccd5ef49578a8cea0df4679826564bad1c9d4ef04462b9f0ded6 AS runtime
WORKDIR /app
LABEL org.opencontainers.image.source="https://github.com/Borge-Labs/ai-dev-team" \
org.opencontainers.image.description="Web control plane for the AI Dev Team research runtime" \
org.opencontainers.image.licenses="MIT"
ENV NODE_ENV=production
# The web serves prebuilt JavaScript and has no runtime package-management need.
# Removing the image-bundled clients also removes an unnecessary supply-chain and
# vulnerability surface from the network-facing container.
RUN rm -rf /usr/local/lib/node_modules/npm /usr/local/lib/node_modules/corepack /opt/yarn-v* \
&& rm -f /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/corepack \
/usr/local/bin/pnpm /usr/local/bin/pnpx /usr/local/bin/yarn /usr/local/bin/yarnpkg
COPY --from=prod-deps /app/node_modules node_modules
COPY --from=prod-deps /app/apps/web/node_modules apps/web/node_modules
COPY --from=prod-deps /app/packages/core/node_modules packages/core/node_modules
COPY package.json ./package.json
COPY apps/web/package.json apps/web/package.json
COPY packages/core/package.json packages/core/package.json
COPY --from=build /app/apps/web/dist apps/web/dist
COPY --from=build /app/packages/core/dist packages/core/dist
COPY ai-dev-team.example.yaml ./ai-dev-team.yaml
COPY config ./config
COPY LICENSE /usr/share/licenses/ai-dev-team/LICENSE
USER node
CMD ["node", "apps/web/dist/server/index.js"]