I'm unable to deploy the simplest docker-compose
file to an ElasticBeanstalk environment configured with Application Load Balancer for high-availability.
This is the docker file:
version: "3.9"
services:
demo:
image: nginxdemos/hello
ports:
- "80:80"
restart: always
This is the ALB configuration:
EB Chain of events:
- Creating CloudWatch alarms and log groups
- Creating security groups
- For the load balancer
- Allow incoming traffic from the internet to my two
listerners
on ports80/443
- Allow incoming traffic from the internet to my two
- For the EC2 machines
- Allow incoming traffic to the
process
port from the first security group created
- Allow incoming traffic to the
- For the load balancer
- Create auto scaling groups
- Create Application Load Balancer
- Create EC2 instance
Approx. 10 minutes after creating the EC2 instance (#5), I get the following log:
Environment health has transitioned from Pending to Severe. ELB processes are not healthy on all instances. Initialization in progress (running for 12 minutes). None of the instances are sending data. 50.0 % of the requests to the ELB are failing with HTTP 5xx. Insufficient request rate (2.0 requests/min) to determine application health (6 minutes ago). ELB health is failing or not available for all instances.
Looking at the Target Group
, it is indicating 0 healthy instances (based on the default healthchecks)
When SSH'ing the instance, I see that the docker
service is not even started, and my application is not running. So that explains why the instance is unhealthy
.
However, what am I supposed to do differently? based on the understanding I have, to me it looks like a bug in the flow initiated by ElasticBealstalk, as the flow is waiting for the instances to be healthy
before starting my application (otherwise, why the application wasn't started in the 10 minutes after the EC2 instance was created?)
It doesn't seem like an application issue, because the docker
service was not even started.
Appreciate your help.