I am deploying my node app on AWS ElasticBeanstalk using the multidocker option. The app appears to deploy successfully, however, I notice that the app (inside my docker) is not actually running.
When I docker inspect <container_id>
the running container, see that "Cmd": null
. If I inspect the ECS task definition created by beanstalk, I also see "command": null"
/
However, if I run the container manually (via docker run -d myimage:latest
), I see "Cmd": ["node", "server.js"]
and the application serves correctly. This is the correct CMD
that is included inside my Dockerfile.
How come my ECS task definition does not read the CMD
from my docker image correctly? Am I suppose to add a command to my Dockerrun.aws.json
? I couldn't find any documentation for this.
Dockerrun.aws.json:
{
"AWSEBDockerrunVersion": 2,
"volumes": [
{
"name": "node-app",
"host": {
"sourcePath": "/var/app/current/node-app"
}
}
],
"containerDefinitions": [
{
"name": "node-app",
"image": "1234565.dkr.ecr.us-east-1.amazonaws.com/my-node-app:testing",
"essential": true,
"memory": 128,
"portMappings": [
{
"hostPort": 3000,
"containerPort": 3000
}
]
}
]
}