Rob*_*Rob 3 amazon-ecs reactjs create-react-app
我正在使用AWS ECS上的docker部署create-react-app。我正在使用dockerhub映像进行测试,该映像几乎是create-react-app的原始版本。启动任务时,它能够拉出容器映像,启动docker容器,但是它挂在运行react-scripts start上。我在容器日志中看到的全部是:
01:51:38 npm info it worked if it ends with ok
01:51:38 npm info using npm@2.15.11
01:51:38 npm info using node@v4.7.3
01:51:42 npm info prestart test-react@0.1.0
01:51:42 npm info start test-react@0.1.0
01:51:42 > test-react@0.1.0 start /usr/src/app
01:51:42 > react-scripts start
01:52:06 Starting the development server...
Run Code Online (Sandbox Code Playgroud)
它只是挂在那里,永远不会完成。但是,当我手动运行docker容器时,一切正常:
Starting the development server...
Compiled successfully!
The app is running at:
http://localhost:3000/
Run Code Online (Sandbox Code Playgroud)
我的Dockerfile是:
FROM node:4-onbuild
# Prepare app directory
RUN mkdir -p /usr/src/app
ADD . /usr/src/app
# Install dependencies
WORKDIR /usr/src/app
RUN npm install
# Build the app
RUN npm build
# Expose the app port
EXPOSE 3000
# Start the app
CMD npm start --loglevel debug
Run Code Online (Sandbox Code Playgroud)
我的package.json:
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Run Code Online (Sandbox Code Playgroud)
寻找有关调试的建议,或者是否有其他我可以做的日志,谢谢!
我想通了-在创建ECS任务中定义容器时,我没有为Docker容器分配足够的内存,因此当它启动服务器时,它的内存不足并冻结。我更改了设置以将更多内存分配给docker容器,现在一切正常。
| 归档时间: |
|
| 查看次数: |
2545 次 |
| 最近记录: |