修改dockerfile
This commit is contained in:
+19
-12
@@ -2,6 +2,14 @@ FROM node:22-bookworm-slim
|
|||||||
|
|
||||||
WORKDIR /app
|
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 \
|
RUN sed -i \
|
||||||
-e 's|http://deb.debian.org/debian|http://mirrors.aliyun.com/debian|g' \
|
-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' \
|
-e 's|http://deb.debian.org/debian-security|http://mirrors.aliyun.com/debian-security|g' \
|
||||||
@@ -14,7 +22,14 @@ RUN sed -i \
|
|||||||
python3-venv \
|
python3-venv \
|
||||||
libgl1 \
|
libgl1 \
|
||||||
libglib2.0-0 \
|
libglib2.0-0 \
|
||||||
|
libxrender1 \
|
||||||
|
libxext6 \
|
||||||
|
libsm6 \
|
||||||
|
libice6 \
|
||||||
|
libfontconfig1 \
|
||||||
fontconfig \
|
fontconfig \
|
||||||
|
fonts-dejavu-core \
|
||||||
|
libgomp1 \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN npm config set registry https://registry.npmmirror.com
|
RUN npm config set registry https://registry.npmmirror.com
|
||||||
@@ -26,19 +41,11 @@ RUN python3 -m pip install \
|
|||||||
build123d
|
build123d
|
||||||
|
|
||||||
COPY text-to-cad ./text-to-cad
|
COPY text-to-cad ./text-to-cad
|
||||||
|
COPY cad-agent-studio ./cad-agent-studio
|
||||||
|
|
||||||
RUN rm -rf text-to-cad/viewer/packages/cadjs \
|
RUN cd cad-agent-studio && npm install --include=dev --no-audit --no-fund
|
||||||
&& cp -R text-to-cad/packages/cadjs text-to-cad/viewer/packages/cadjs \
|
RUN cd cad-agent-studio && npm run build
|
||||||
&& 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
|
|
||||||
|
|
||||||
EXPOSE 3000
|
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"],
|
transpilePackages: ["cadjs", "three", "three-mesh-bvh"],
|
||||||
turbopack: {
|
turbopack: {
|
||||||
resolveAlias: {
|
resolveAlias: {
|
||||||
|
"@": "./src",
|
||||||
cadjs: "./src/viewer-cadjs",
|
cadjs: "./src/viewer-cadjs",
|
||||||
three: "./node_modules/three",
|
three: "./node_modules/three",
|
||||||
"three/examples": "./node_modules/three/examples",
|
"three/examples": "./node_modules/three/examples",
|
||||||
@@ -21,6 +22,7 @@ const nextConfig: NextConfig = {
|
|||||||
config.resolve = config.resolve || {};
|
config.resolve = config.resolve || {};
|
||||||
config.resolve.alias = {
|
config.resolve.alias = {
|
||||||
...(config.resolve.alias || {}),
|
...(config.resolve.alias || {}),
|
||||||
|
"@": path.join(appRoot, "src"),
|
||||||
cadjs: cadJsSrc,
|
cadjs: cadJsSrc,
|
||||||
three: path.join(appRoot, "node_modules", "three"),
|
three: path.join(appRoot, "node_modules", "three"),
|
||||||
"three/examples": path.join(appRoot, "node_modules", "three", "examples"),
|
"three/examples": path.join(appRoot, "node_modules", "three", "examples"),
|
||||||
|
|||||||
+6
-4
@@ -9,10 +9,12 @@ services:
|
|||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
PORT: 3000
|
PORT: 3000
|
||||||
DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY}
|
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:
|
ports:
|
||||||
- "127.0.0.1:53821:3000"
|
- "127.0.0.1:53821:3000"
|
||||||
volumes:
|
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