我正在尝试为连接到 redis 的 nodejs 应用程序创建任务定义。我尝试了几种不同的任务定义,但是当我在集群中运行它们时,它们都失败了,因为我的应用程序无法连接到 redis。下面列出了我的任务定义、日志输出、我的任务定义所基于的 docker-compose.yml 和我的 api dockerfile。
任务定义
{
"ipcMode": null,
"executionRoleArn": "arn:aws:iam::210939474461:role/ecsTaskExecutionRole",
"containerDefinitions": [
{
"dnsSearchDomains": null,
"logConfiguration": {
"logDriver": "awslogs",
"secretOptions": null,
"options": {
"awslogs-group": "/ecs/rest-api-explorer",
"awslogs-region": "us-west-2",
"awslogs-stream-prefix": "ecs"
}
},
"entryPoint": null,
"portMappings": [
{
"hostPort": 0,
"protocol": "tcp",
"containerPort": 3000
},
{
"hostPort": 0,
"protocol": "tcp",
"containerPort": 6379
}
],
"command": null,
"linuxParameters": null,
"cpu": 0,
"environment": [
{
"name": "redis_server_addr",
"value": "redis"
}
],
"resourceRequirements": null,
"ulimits": null,
"dnsServers": null,
"mountPoints": …Run Code Online (Sandbox Code Playgroud)