【问题标题】:Strapi v3.0.0.alpha.12.4 not working with AWSStrapi v3.0.0.alpha.12.4 不适用于 AWS
【发布时间】:2018-11-30 16:34:34
【问题描述】:

我是 AWS ECS 的新手。我使用旧版本的 strapi 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"
      }
    }
  ]
}

【问题讨论】:

  • 更新:任务定义是这样的。

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


【解决方案1】:

回答我自己的问题。

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

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

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

【讨论】:

    猜你喜欢
    • 2021-11-16
    • 2013-01-02
    • 2021-04-22
    • 2016-02-07
    • 1970-01-01
    • 1970-01-01
    • 2011-11-23
    • 2020-07-03
    • 1970-01-01
    相关资源
    最近更新 更多