midwayjs / midway

🍔 A Node.js Serverless Framework for front-end/full-stack developers. Build the application for next decade. Works on AWS, Alibaba Cloud, Tencent Cloud and traditional VM/Container. Super easy integrate with React and Vue. 🌈
https://www.midwayjs.org/
MIT License
7.4k stars 576 forks source link

Docker build midway "command build not found" #686

Closed ljjeseller closed 4 years ago

ljjeseller commented 4 years ago

but i run "npm run build" in my project root it's ok; here is my package.json;

{ "name": "robots-company-api", "version": "1.0.0", "description": "{{description}}", "private": true, "dependencies": { "@midwayjs/decorator": "^2.3.0", "@midwayjs/orm": "^1.1.1", "@midwayjs/web": "^2.3.0", "egg": "^2.0.0", "egg-cors": "^2.2.3", "egg-scripts": "^2.10.0", "midway": "^2.3.0", "mysql2": "^2.2.5" }, "devDependencies": { "@midwayjs/cli": "^1.0.0", "@midwayjs/egg-ts-helper": "^1.0.1", "@midwayjs/mock": "^2.3.0", "@types/jest": "^26.0.10", "@types/node": "14", "cross-env": "^6.0.0", "jest": "^26.4.0", "mwts": "^1.0.5", "ts-jest": "^26.2.0", "ts-node": "^9.0.0", "typescript": "^3.9.0" }, "engines": { "node": ">=12.0.0" }, "scripts": { "start": "egg-scripts start --title=robots-company-api --framework=midway", "stop": "egg-scripts stop --title=robots-company-api", "start_build": "npm run build && cross-env NODE_ENV=development midway-bin dev", "dev": "cross-env ets && cross-env NODE_ENV=local midway-bin dev --ts", "test": "midway-bin test", "cov": "midway-bin cov", "lint": "mwts check", "lint:fix": "mwts fix", "ci": "npm run cov", "build": "midway-bin build -c", "typeorm": "node --require ts-node/register ./node_modules/typeorm/cli.js" }, "midway-bin-clean": [ ".vscode/.tsbuildinfo", "dist" ], "repository": { "type": "git", "url": "" }, "author": "anonymous", "license": "MIT" }

and this is my dockerfile;

图片 图片
ljjeseller commented 4 years ago

i finally found the problem; it can not use alpine's image; maybe something in midway used c environment is incompatible with alpine;