-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile.cloud
More file actions
39 lines (28 loc) · 1.24 KB
/
Dockerfile.cloud
File metadata and controls
39 lines (28 loc) · 1.24 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
FROM node:24-bookworm-slim AS build
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends python3 make g++ \
&& rm -rf /var/lib/apt/lists/* \
&& corepack enable
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
COPY patches ./patches
RUN pnpm install --frozen-lockfile --ignore-scripts
COPY . .
RUN BETTER_SQLITE3_DIR="$(dirname "$(find node_modules/.pnpm -path '*/node_modules/better-sqlite3/package.json' -print -quit)")" \
&& cd "$BETTER_SQLITE3_DIR" \
&& npm run build-release \
&& cd /app \
&& ./node_modules/.bin/vite build --config vite.cloud.config.ts \
&& CI=true pnpm --config.verify-deps-before-run=false prune --prod --ignore-scripts
FROM node:24-bookworm-slim AS runtime
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=4021
ENV DAEMON_AI_CLOUD_HOST=0.0.0.0
COPY --from=build /app/package.json ./package.json
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist-cloud ./dist-cloud
EXPOSE 4021
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD node -e "fetch('http://127.0.0.1:'+(process.env.PORT||4021)+'/health/ready').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
CMD ["node", "dist-cloud/daemon-ai-cloud-server.mjs"]