修改dockerfile
This commit is contained in:
+19
-12
@@ -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}"]
|
||||
CMD ["sh", "-lc", "cd /app/cad-agent-studio && npm run start -- -H 0.0.0.0 -p ${PORT}"]
|
||||
|
||||
@@ -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"),
|
||||
|
||||
+6
-4
@@ -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
|
||||
Reference in New Issue
Block a user