Strapi v3.0.0.alpha.12.4不适用于AWS

时间:2018-06-21 11:02:04

标签: amazon-web-services docker docker-compose amazon-ecs strapi

我是AWS ECS的新手。我使用旧版本的trapi alpha.12启动了一个ECS实例,该实例在启动端运行良好,但存在一些错误。出现了新版本的alpha.12.4,修复了这些错误。我在本地运行了一个容器,它运行正常。我在版本3中使用了docker-compose。

问题出在我在AWS中部署此容器时。我使用与上一个工作实例相同的任务定义,只是更改了标记。我将特定标签用于最新版本,而不是最新版本,以排除任何缓存可能性。当然,我也尝试过使用最新标签。他们似乎都不起作用。

最后一次尝试是,我使用ECS CLI部署了容器,问题仍然存在。

任何解决此问题的指针都很好。

更新

{
  "executionRoleArn": null,
  "containerDefinitions": [
    {
      "dnsSearchDomains": [],
      "logConfiguration": null,
      "entryPoint": [],
      "portMappings": [
        {
          "hostPort": 80,
          "protocol": "tcp",
          "containerPort": 1337
        }
      ],
      "command": [],
      "linuxParameters": {
        "capabilities": {
          "add": null,
          "drop": null
        },
        "sharedMemorySize": null,
        "tmpfs": null,
        "devices": null,
        "initProcessEnabled": null
      },
      "cpu": 10,
      "environment": [
        {
          "name": "APP_NAME",
          "value": "strapi-app"
        },
        {
          "name": "DATABASE_CLIENT",
          "value": "mongo"
        },
        {
          "name": "DATABASE_HOST",
          "value": "db"
        },
        {
          "name": "DATABASE_NAME",
          "value": "strapi"
        },
        {
          "name": "DATABASE_PASSWORD",
          "value": ""
        },
        {
          "name": "DATABASE_PORT",
          "value": "27017"
        },
        {
          "name": "DATABASE_USERNAME",
          "value": ""
        }
      ],
      "ulimits": null,
      "dnsServers": [],
      "mountPoints": [
        {
          "readOnly": false,
          "containerPath": "/usr/src/api/strapi-app",
          "sourceVolume": "volume-0"
        }
      ],
      "workingDirectory": null,
      "dockerSecurityOptions": [],
      "memory": 512,
      "memoryReservation": null,
      "volumesFrom": [],
      "image": "strapi/strapi",
      "disableNetworking": null,
      "healthCheck": null,
      "essential": true,
      "links": [
        "db"
      ],
      "hostname": null,
      "extraHosts": null,
      "user": null,
      "readonlyRootFilesystem": false,
      "dockerLabels": null,
      "privileged": false,
      "name": "api"
    },
    {
      "dnsSearchDomains": [],
      "logConfiguration": null,
      "entryPoint": [],
      "portMappings": [
        {
          "hostPort": 27017,
          "protocol": "tcp",
          "containerPort": 27017
        }
      ],
      "command": [],
      "linuxParameters": {
        "capabilities": {
          "add": null,
          "drop": null
        },
        "sharedMemorySize": null,
        "tmpfs": null,
        "devices": null,
        "initProcessEnabled": null
      },
      "cpu": 10,
      "environment": [
        {
          "name": "MONGO_INITDB_DATABASE",
          "value": "strapi"
        }
      ],
      "ulimits": null,
      "dnsServers": [],
      "mountPoints": [
        {
          "readOnly": false,
          "containerPath": "/data/db",
          "sourceVolume": "volume-2"
        }
      ],
      "workingDirectory": null,
      "dockerSecurityOptions": [],
      "memory": 512,
      "memoryReservation": null,
      "volumesFrom": [],
      "image": "mongo",
      "disableNetworking": null,
      "healthCheck": null,
      "essential": true,
      "links": [],
      "hostname": null,
      "extraHosts": null,
      "user": null,
      "readonlyRootFilesystem": false,
      "dockerLabels": null,
      "privileged": false,
      "name": "db"
    }
  ],
  "placementConstraints": [],
  "memory": null,
  "taskRoleArn": "arn:aws:iam::**myaccount**:role/ecsTaskExecutionRole",
  "compatibilities": [
    "EC2"
  ],
  "taskDefinitionArn": "arn:aws:ecs:eu-central-1:**myaccount**:task-definition/sriharsha:16",
  "family": "sriharsha",
  "requiresAttributes": [
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "com.amazonaws.ecs.capability.docker-remote-api.1.17"
    },
    {
      "targetId": null,
      "targetType": null,
      "value": null,
      "name": "com.amazonaws.ecs.capability.task-iam-role"
    }
  ],
  "requiresCompatibilities": [
    "EC2"
  ],
  "networkMode": "bridge",
  "cpu": null,
  "revision": 16,
  "status": "ACTIVE",
  "volumes": [
    {
      "name": "volume-2",
      "host": {
        "sourcePath": "/db"
      }
    },
    {
      "name": "volume-0",
      "host": {
        "sourcePath": "/strapi-app"
      }
    },
    {
      "name": "volume-1",
      "host": {
        "sourcePath": "/usr/src/api/strapi-app/node_modules"
      }
    }
  ]
}

1 个答案:

答案 0 :(得分:1)

回答我自己的问题。

我基于12.5版本构建了一个新的自定义映像,它与AWS EKS配合良好。

在dockerhub上的官方存储库中尚未找到该映像。

我的自定义图片可以从spolimetla / strapi中提取