fix: 使用jq正确处理package.json移除workspace依赖
sed直接删除行会导致JSON尾随逗号问题,改用jq 正确删除dependencies中的@iconsulting/shared键 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
7417bc1d82
commit
2f9fd3995b
|
|
@ -36,7 +36,10 @@ COPY --from=builder /app/packages/shared/dist ./node_modules/@iconsulting/shared
|
|||
COPY --from=builder /app/packages/shared/package.json ./node_modules/@iconsulting/shared/
|
||||
|
||||
# 移除 workspace: 协议依赖并安装生产依赖
|
||||
RUN sed -i '/@iconsulting/d' package.json && npm install --omit=dev --ignore-scripts
|
||||
RUN apk add --no-cache jq && \
|
||||
jq 'del(.dependencies["@iconsulting/shared"])' package.json > package.tmp.json && \
|
||||
mv package.tmp.json package.json && \
|
||||
npm install --omit=dev --ignore-scripts
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3004
|
||||
|
|
|
|||
|
|
@ -36,7 +36,10 @@ COPY --from=builder /app/packages/shared/dist ./node_modules/@iconsulting/shared
|
|||
COPY --from=builder /app/packages/shared/package.json ./node_modules/@iconsulting/shared/
|
||||
|
||||
# 移除 workspace: 协议依赖并安装生产依赖
|
||||
RUN sed -i '/@iconsulting/d' package.json && npm install --omit=dev --ignore-scripts
|
||||
RUN apk add --no-cache jq && \
|
||||
jq 'del(.dependencies["@iconsulting/shared"])' package.json > package.tmp.json && \
|
||||
mv package.tmp.json package.json && \
|
||||
npm install --omit=dev --ignore-scripts
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3005
|
||||
|
|
|
|||
|
|
@ -36,7 +36,10 @@ COPY --from=builder /app/packages/shared/dist ./node_modules/@iconsulting/shared
|
|||
COPY --from=builder /app/packages/shared/package.json ./node_modules/@iconsulting/shared/
|
||||
|
||||
# 移除 workspace: 协议依赖并安装生产依赖
|
||||
RUN sed -i '/@iconsulting/d' package.json && npm install --omit=dev --ignore-scripts
|
||||
RUN apk add --no-cache jq && \
|
||||
jq 'del(.dependencies["@iconsulting/shared"])' package.json > package.tmp.json && \
|
||||
mv package.tmp.json package.json && \
|
||||
npm install --omit=dev --ignore-scripts
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3003
|
||||
|
|
|
|||
|
|
@ -36,7 +36,10 @@ COPY --from=builder /app/packages/shared/dist ./node_modules/@iconsulting/shared
|
|||
COPY --from=builder /app/packages/shared/package.json ./node_modules/@iconsulting/shared/
|
||||
|
||||
# 移除 workspace: 协议依赖并安装生产依赖
|
||||
RUN sed -i '/@iconsulting/d' package.json && npm install --omit=dev --ignore-scripts
|
||||
RUN apk add --no-cache jq && \
|
||||
jq 'del(.dependencies["@iconsulting/shared"])' package.json > package.tmp.json && \
|
||||
mv package.tmp.json package.json && \
|
||||
npm install --omit=dev --ignore-scripts
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3002
|
||||
|
|
|
|||
|
|
@ -47,7 +47,10 @@ COPY --from=builder /app/packages/shared/dist ./node_modules/@iconsulting/shared
|
|||
COPY --from=builder /app/packages/shared/package.json ./node_modules/@iconsulting/shared/
|
||||
|
||||
# 移除 workspace: 协议依赖并安装生产依赖
|
||||
RUN sed -i '/@iconsulting/d' package.json && npm install --omit=dev --ignore-scripts
|
||||
RUN apk add --no-cache jq && \
|
||||
jq 'del(.dependencies["@iconsulting/shared"])' package.json > package.tmp.json && \
|
||||
mv package.tmp.json package.json && \
|
||||
npm install --omit=dev --ignore-scripts
|
||||
|
||||
# 设置环境变量
|
||||
ENV NODE_ENV=production
|
||||
|
|
|
|||
Loading…
Reference in New Issue