I want to run a SMTP server on a Docker container in Elastic Beanstalk, so in my Dockerfile I have exposed the port 25 (and no other ports)
EXPOSE 25
I also edited the beanstalk load balancer (using EC2 web admin) and added port 25 to it:
| LB Protocol | LB Port | Instance Protocol | Instance Port | SSL |
| TCP | 25 | TCP | 25 | N/A |
....
And edited the security group of the instance to allow inbound TCP traffic to port 25 (allowed all locations to be able to connect to the instance directly).
Doesn't seem to work though. If I use the same Dockerfile in Virtualbox (using option -p 25:25
) I can connect to the port 25 through the host machine and the SMTP server is listening. If I run the container in Elastic Beanstalk using the before-mentioned configuration I can't connect to the port 25 neither using the load balancer or directly the EC2 instance.
Any ideas what I'm doing wrong here?