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

Strapi v3.0.0.alpha.12.4 not working with AWS

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

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

作为最后一次尝试,我使用 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"
      }
    }
  ]
}

回答我自己的问题。

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

在 dockerhub 的官方仓库中还没有找到该镜像。

我的自定义图像可以从spolimetla/strapi

中提取