修改dockerfile

This commit is contained in:
2026-07-28 15:24:43 +08:00
parent 51bb84c378
commit 4572803e72
3 changed files with 27 additions and 16 deletions
+19 -12
View File
@@ -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}"]