在我的应用程序中,我使用了 ruby 和 rails 应用程序。该应用程序在 ngix+passanger 上运行。我也使用过 Redis 和 sidekiq。我想在 ECS Fargate 上运行我的应用程序。
我已经实现了以下步骤:
我的 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'
当我运行任务时,我收到如下错误:错误
最佳答案
在您的 Fargate 任务中,确保安全组允许端口 6379。在我看来,他的端口上的流量没有通过,导致运行状况检查失败并使任务不健康并被调度程序删除。
关于docker - 使用 Fargate 在 ECS 上运行 Redis,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62620144/