From 4572803e72736e91d53322cd4267cb1fe07b296d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BA=B7?= Date: Tue, 28 Jul 2026 15:24:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 31 +++++++++++++++++++------------ cad-agent-studio/next.config.ts | 2 ++ docker-compose.yml | 10 ++++++---- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index f7fdc65..aa53c1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,14 @@ FROM node:22-bookworm-slim WORKDIR /app +ENV NODE_ENV=production +ENV HOSTNAME=0.0.0.0 +ENV PORT=3000 +ENV CAD_AGENT_STUDIO_ROOT=/app/cad-agent-studio +ENV CAD_ENGINE_ROOT=/app/text-to-cad +ENV CAD_AGENT_STUDIO_CONFIG=/app/cad-agent-studio/config/llm.config.yaml +ENV PYTHONPATH=/app/text-to-cad/packages/cadpy/src + RUN sed -i \ -e 's|http://deb.debian.org/debian|http://mirrors.aliyun.com/debian|g' \ -e 's|http://deb.debian.org/debian-security|http://mirrors.aliyun.com/debian-security|g' \ @@ -14,7 +22,14 @@ RUN sed -i \ python3-venv \ libgl1 \ libglib2.0-0 \ + libxrender1 \ + libxext6 \ + libsm6 \ + libice6 \ + libfontconfig1 \ fontconfig \ + fonts-dejavu-core \ + libgomp1 \ && rm -rf /var/lib/apt/lists/* RUN npm config set registry https://registry.npmmirror.com @@ -26,19 +41,11 @@ RUN python3 -m pip install \ build123d COPY text-to-cad ./text-to-cad +COPY cad-agent-studio ./cad-agent-studio -RUN rm -rf text-to-cad/viewer/packages/cadjs \ - && cp -R text-to-cad/packages/cadjs text-to-cad/viewer/packages/cadjs \ - && rm -rf text-to-cad/viewer/packages/implicitjs \ - && cp -R text-to-cad/packages/implicitjs text-to-cad/viewer/packages/implicitjs - -RUN cd text-to-cad/viewer && npm install -RUN cd text-to-cad/apps/cad-agent-studio && npm install && npm run build - -ENV NODE_ENV=production -ENV HOSTNAME=0.0.0.0 -ENV PORT=3000 +RUN cd cad-agent-studio && npm install --include=dev --no-audit --no-fund +RUN cd cad-agent-studio && npm run build EXPOSE 3000 -CMD ["sh", "-lc", "cd /app/text-to-cad/apps/cad-agent-studio && npm run start -- -H 0.0.0.0 -p ${PORT}"] \ No newline at end of file +CMD ["sh", "-lc", "cd /app/cad-agent-studio && npm run start -- -H 0.0.0.0 -p ${PORT}"] diff --git a/cad-agent-studio/next.config.ts b/cad-agent-studio/next.config.ts index dc78103..07f0500 100644 --- a/cad-agent-studio/next.config.ts +++ b/cad-agent-studio/next.config.ts @@ -9,6 +9,7 @@ const nextConfig: NextConfig = { transpilePackages: ["cadjs", "three", "three-mesh-bvh"], turbopack: { resolveAlias: { + "@": "./src", cadjs: "./src/viewer-cadjs", three: "./node_modules/three", "three/examples": "./node_modules/three/examples", @@ -21,6 +22,7 @@ const nextConfig: NextConfig = { config.resolve = config.resolve || {}; config.resolve.alias = { ...(config.resolve.alias || {}), + "@": path.join(appRoot, "src"), cadjs: cadJsSrc, three: path.join(appRoot, "node_modules", "three"), "three/examples": path.join(appRoot, "node_modules", "three", "examples"), diff --git a/docker-compose.yml b/docker-compose.yml index 7a97c2c..a70c69e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,10 +9,12 @@ services: NODE_ENV: production PORT: 3000 DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY} + CAD_AGENT_STUDIO_ROOT: /app/cad-agent-studio + CAD_ENGINE_ROOT: /app/text-to-cad + CAD_AGENT_STUDIO_CONFIG: /app/cad-agent-studio/config/llm.config.yaml + PYTHONPATH: /app/text-to-cad/packages/cadpy/src ports: - "127.0.0.1:53821:3000" volumes: - - ./text-to-cad/models/agent-studio:/app/text-to-cad/models/agent-studio - - - + - ./cad-agent-studio/models/agent-studio:/app/cad-agent-studio/models/agent-studio + - ./cad-agent-studio/config/llm.config.yaml:/app/cad-agent-studio/config/llm.config.yaml:ro \ No newline at end of file