I'm trying to set up a simple PHP and Nginx configuration using AWS Fargate with multiple containers. However, I'm having trouble getting the containers to communicate with each other. When I run both Nginx and PHP in the same container, everything works fine, but that's not the setup I'm aiming for. I'd love to see if anyone else has set up Fargate tasks with multiple containers successfully and if you could share your configuration, especially with regard to task definitions and networking. Here's my CDK configuration for reference: [RizaHKhan/fargate-practice at simple](https://github.com/RizaHKhan/fargate-practice/tree/simple) and the application is here: [RizaHKhan/nginx-fargate: simple infra](https://github.com/RizaHKhan/nginx-fargate). Any insights or advice would be greatly appreciated!
1 Answer
It sounds like your containers should be able to talk to each other since they’re on the same task. They typically communicate over localhost using their respective ports. Double-check your task definition and networking settings to ensure everything is set up right!
Thanks for the tip! I think I might have messed something up in the CDK side of the task definition.