我试图在AWS beanstalk上部署多个node.js微服务,并且我希望将它们部署在同一实例上。这是我第一次部署多种服务,所以有些失败我需要某人帮助我。所以,我试图首先将它们打包在码头集装箱中。同时,我正在使用码头作曲家来管理结构。它在本地虚拟机中启动并运行,但是当我将它部署到beanstalk时,遇到了一些问题。使用docker composer在AWS beanstalk上部署docker
我所知道的:
- 我知道我必须选择部署的多集装箱码头工人。
- 管理多个node.js服务的最佳实践是使用docker composer。
- 我需要一个
dockerrun.aws.json
node.js应用程序。 - 我需要为该ecs实例创建任务定义。
哪里有问题:
- 我只能找到PHP
dockerrun.aws.json
和task_definition.json
模板,所以我无法验证,如果我在这两个JSON文件的node.js 配置在正确的形状。 - 看起来好像
docker-compose.yml
,dockerrun.aws.json
和task_definition.json
正在做类似的工作。我必须保留 task_definition,但是我还需要dockerrun.aws.json吗? - 我试图在ecs中运行任务,但它立即停止。我怎样才能检查日志的任务?
我:在环境
发现
没有ECS任务定义(或空定义文件),因为我任务都将会立即停止。如果我可以查看日志,那么我可以更容易地进行故障排除。
这里是我的
task_definition.json
:{ "requiresAttributes": [], "taskDefinitionArn": "arn:aws:ecs:us-east-1:231440562752:task-definition/ComposerExample:1", "status": "ACTIVE", "revision": 1, "containerDefinitions": [ { "volumesFrom": [], "memory": 100, "extraHosts": null, "dnsServers": null, "disableNetworking": null, "dnsSearchDomains": null, "portMappings": [ { "hostPort": 80, "containerPort": 80, "protocol": "tcp" } ], "hostname": null, "essential": true, "entryPoint": null, "mountPoints": [ { "containerPath": "/usr/share/nginx/html", "sourceVolume": "webdata", "readOnly": true } ], "name": "nginxexpressredisnodemon_nginx_1", "ulimits": null, "dockerSecurityOptions": null, "environment": [], "links": null, "workingDirectory": null, "readonlyRootFilesystem": null, "image": "nginxexpressredisnodemon_nginx", "command": null, "user": null, "dockerLabels": null, "logConfiguration": null, "cpu": 99, "privileged": null } ], "volumes": [ { "host": { "sourcePath": "/ecs/webdata" }, "name": "webdata" } ], "family": "ComposerExample" }
也许这将帮助https://github.com/ingenieux/beanstalker/issues/63 – taco
@taco,这不正是我要找的,但我可能以及在此问题跟踪器中发布我的问题,谢谢。 –
而我没有使用他们的beanstalker –