sorrycc / roadhog

🐷 Cli tool for creating react apps, configurable version of create-react-app.
2.72k stars 341 forks source link

run roadhog in docker container hang #671

Open hightall opened 6 years ago

hightall commented 6 years ago

在docker容器里面运行roadhog build,一直停在读取.eslintrc那里,走不下去。 af-webpack:getUserConfig UserConfig: {"entry":"app/assets/src/index.js","extraBabelPlugins":["transform-decorators-legacy",["import",{"libraryName":"antd","libraryDirectory":"es","style":true}]],"alias":{"components":"/app/app/assets/src/components"},"ignoreMomentLocale":true,"theme":"./app/assets/src/theme.js","outputPath":"app/public","publicPath":"/static/dist/","hash":false} +0ms roadhog:build user config: {"entry":"app/assets/src/index.js","extraBabelPlugins":["transform-decorators-legacy",["import",{"libraryName":"antd","libraryDirectory":"es","style":true}]],"alias":{"components":"/app/app/assets/src/components"},"ignoreMomentLocale":true,"theme":"./app/assets/src/theme.js","outputPath":"app/public","publicPath":"/static/dist/","hash":false} +0ms roadhog:getWebpackConfig babel: /app/node_modules/roadhog/lib/babel.js +0ms roadhog:getWebpackConfig browserslist: last 2 versions +0ms babel:config:config-chain Ignored '/app/app/assets/src/theme.js' because it failed to match one of [ /(\/app\/.roadhogrc.mock.js|\/app\/.webpackrc.js|\/app\/webpack.config.js|\/app\/mock|\/app\/src)/ ] from '/app' +0ms af-webpack:getConfig use user's eslint bin: /app/node_modules/eslint/lib/api.js +0ms af-webpack:getConfig userRc: {"extends":"eslint-config-egg"} +1ms af-webpack:getConfig use user's .eslintrc: /app/.eslintrc +0ms

colinzhy commented 6 years ago

同问!!! 本地启动和编译都能正常执行,但是在docker容器中启动(npm start或者npm run build都不行(Ant-Design搭建的项目,引入了roadhog),也尝试过分解环境变量,安装roadhog之后直接执行roadhog build,也是挂住不动了。

colinzhy commented 6 years ago

@HaitaoYue 你这个日志怎么查看到的?

addunt commented 6 years ago

遇到了同样的问题,请问最终怎么解决的?

colinzhy commented 6 years ago

目前还没解决,有人说可能是roadhog升级2.3.0导致的,你也可以试试,参考: https://github.com/sorrycc/roadhog/issues/647

不过我尝试降级到2.2.0版本,没啥效果。。。

现在只能用一个不太喜欢的办法,用ngnix部署编译后的静态文件,在启动容器之前将后端服务器的域名用sed命令替换进去

scottming commented 6 years ago

同样遇到 build 卡住的问题。

mogmog commented 6 years ago

This is affecting me too. Can any one confirm if it has ever worked in Docker?

mike-sino commented 6 years ago

The same question! I tried to start the server by using the command roadhog server, while there is no response for a long time

mogmog commented 6 years ago

any progress on this?

scottming commented 6 years ago

Use umijs.org and set TS_CONFIG_PATHS_PLUGIN=none will fix this trouble. @mogmog

mike-sino commented 6 years ago

@mogmog Maybe it would be better to use dva in docker instead of using roadhog directly

lvao813 commented 5 years ago

我也遇到了同样的问题,这个问题已经卡了我两天了,静态文件部署是可以,但无法做到自动化docker build