docker - 使用 Fargate 在 ECS 上运行 Redis

标签 docker redis docker-compose amazon-ecs aws-fargate

在我的应用程序中,我使用了 ruby​​ 和 rails 应用程序。该应用程序在 ngix+passanger 上运行。我也使用过 Redis 和 sidekiq。我想在 ECS Fargate 上运行我的应用程序。
我已经实现了以下步骤:

  • 使用 docker 文件
  • 创建 Docker 镜像
  • 网站
  • 网络服务器
  • 雷迪斯
  • Sidekiq
  • 将 docker 镜像推送到 ECR
  • 使用 Fargate 创建任务
  • 使用 Fargate 在 ECS 上运行任务

  • 我的 docker-compose 文件如下:
    version: '3.7' 
    
    services:
      web:
        build: 
            context: .
            dockerfile: ./Dockerfile
        ports : 
          -  3000:3000 
        env_file:
          - .env
    
      webserver:
        build : 
          context: .      
          dockerfile: ./nginx/Dockerfile 
        links: 
          - 'web'
        ports : 
          -  80:80 
        env_file:
          - .env
    
      redis:
        build : 
          context: .
          dockerfile: ./redis/Dockerfile 
        volumes:
          - ../../tmp/db:/var/lib/redis/data
        ports:
          - '6379:6379'
    
      sidekiq:
        build: .
        command: 'bundle exec sidekiq'    
    
    当我运行任务时,我收到如下错误:
    错误
    enter image description here

    最佳答案

    在您的 Fargate 任务中,确保安全组允许端口 6379。在我看来,他的端口上的流量没有通过,导致运行状况检查失败并使任务不健康并被调度程序删除。

    关于docker - 使用 Fargate 在 ECS 上运行 Redis,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62620144/

    相关文章:

    azure - 如何为 Azure Functions 和 Playwright 创建多级 docker 文件?

    go - 如何使用 redigo 库从 golang 查询 Redis 数据库

    mysql - 在 docker 中连接到 mysql

    docker - 将VuePress与docker和NGINX传递一起使用

    docker - 文件夹权限docker-osx-dev

    docker - tar ( child ):prometheus-2.8.1.linux-amd64.tar.gz:无法打开:没有这样的文件或目录

    node.js - 幻影 JS + Docker : html font-family is not respected when converting from HTML

    python - django-rq Redis 客户端发送了 AUTH,但没有设置密码

    redis - 在redis中将对象存储在有序集合中的常规方法是什么?

    mysql - Docker 构建失败