发现,我的strapi dockerfile实际上并没有运行
npm
构建,我必须实际使用
bash
build.env
之后与运行,然后shell脚本运行
source build.env
首先npm build
# Create a build script that sources build.env and runs the Strapi build command
RUN echo '#!/bin/bash\nsource build.env\nnpm run build -- --debug' > build.sh && chmod +x build.sh
# Run the build script explicitly with bash
RUN echo "==== Building Strapi Application ====" && /bin/bash build.sh || { cat logfile || echo "No logfile found"; exit 1; } && echo "==== Strapi Build Completed ===="