得到一个问题,其中的构建不退出,只是挂起,似乎是一个docker的问题,不知道是否与构建脚本或docker配置问题.
错误在下面.
08:50:26 dist/js/chunk-vendors.5fdcf219.js 1535.30 KiB 407.76 KiB
08:50:26 dist/js/chunk-fd02e1a8.e5248c2e.js 320.44 KiB 31.10 KiB
08:50:26 dist/js/app.5c1491df.js 56.47 KiB 14.33 KiB
08:50:26 dist/js/chunk-4650e401.6a578735.js 16.14 KiB 4.33 KiB
08:50:26 dist/css/chunk-vendors.fef290ac.css 677.70 KiB 85.83 KiB
08:50:26 dist/css/chunk-4650e401.e054842e.css 224.21 KiB 28.29 KiB
08:50:26 dist/css/app.7ac31790.css 192.56 KiB 28.69 KiB
08:50:26 dist/css/chunk-fd02e1a8.280e1f3c.css 9.79 KiB 1.89 KiB
08:50:26
08:50:26 Images and other types of assets omitted.
08:50:26
08:50:26 DONE Build complete. The dist directory is ready to be deployed.
08:50:26 INFO Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html
这是 docker 脚本.
FROM node16.10-alpine3.11 as build-stage
USER root
WORKDIR /app
COPY app/ ./
RUN chown -R root:root /app
RUN npm install --verbose
# fails here
RUN npm run build --verbose
RUN npm prune --production
FROM nginx:1.19.10 as production-stage
COPY --from=build-stage --chown=1000:1000 /app/dist /usr/share/nginx/html
COPY --chown=1000:1000 ./nginx-config/nginx.conf /etc/nginx/nginx.conf
COPY --chown=1000:1000 ./nginx-config/default.conf /etc/nginx/conf.d/default.conf
COPY --chown=1000:1000 ./config/* /usr/share/nginx/html/
COPY --chown=1000:1000 entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["run.sh"]
...
和更老的项目,Package.json
{
"name": "myapp",
"version": "0.1.3",
"private": true,
"scripts": {
"serve": "./serve.sh",
"build": "vue-cli-service build && npm run test:unit",
"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit --no-cache"
},
"dependencies": {
"@vue/eslint-config-airbnb": "^4.0.1",
"axios": "0.18.0",
"babel-polyfill": "6.26.0",
"core-util-is": "^1.0.2",
"lodash": "^4.17.15",
"moment": "2.29.4",
"vue": "2.5.19",
"vue-cookies": "^1.8.2",
"vue-i18n": "8.28.0",
"vue-router": "3.6.5",
"vue-template-compiler": "2.5.19",
"vuelidate": "0.7.4",
"vuetify": "1.2.1",
"vuex": "3.0.1"
},
"devDependencies": {
"@babel/plugin-proposal-optional-chaining": "^7.2.0",
"@babel/polyfill": "^7.0.0-beta.49",
"@babel/preset-env": "^7.3.1",
"@kazupon/vue-i18n-loader": "^0.3.0",
"@vue/cli-plugin-babel": "^3.10.0",
"@vue/cli-plugin-eslint": "^3.10.0",
"@vue/cli-plugin-unit-jest": "^3.10.0",
"@vue/cli-service": "^3.10.0",
"@vue/test-utils": "^1.0.0-beta.29",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.0.1",
"html-loader": "^0.5.5",
"jest-raw-loader": "^1.0.1",
"lint-staged": "^7.2.2",
"raw-loader": "^3.1.0",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"vue-cli-plugin-i18n": "^0.5.0",
"vue-cli-plugin-vuetify": "^0.1.6",
"vue-loader": "^15.4.2",
"handlebars": "4.5.0"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"src/**/*.js": [
"vue-cli-service lint",
"git add"
],
"*.vue": [
"vue-cli-service lint",
"git add"
]
}
}