jeudi 8 janvier 2015

AWS Elastic Beanstalk, Dockerrun.aws.json and multiple ports on docker run

First, sorry for my bad english, I'm a french developer.


I explain you my situation.


I wish to run a docker in a EC2 instance with AWS API, and I have a Dockerrun.aws.json like this:



{
"AWSEBDockerrunVersion": "1",
"Authentication": {
"Bucket": "<BUCKET>",
"Key": ".dockercfg"
},
"Image": {
"Name": "<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "80"
},
{
"ContainerPort": "443"
}
]
}


Like you can see, I have multiple ports to expose, but elastic beanstalk expose only the first of they. I searched in the documentation, and at this page : http://ift.tt/1l41qUW


I found this sentence : «You can specify multiple container ports, but AWS Elastic Beanstalk uses only the first one to connect your container to the host's reverse proxy and route requests from the public Internet.»


And my question is why ? I have an authentication which use Oauth2 protocol, and I must use HTTPS protocol for obvious security reasons. With this restriction, I can only choose HTTP or HTTPS, because I can only expose port 80 or 443.


I tried to tinker ebextensions to make nginx redirections with ports at the level of EC2 instances, but i've failed. How can I do ?


This stackoverflow user has the same problem. Exposing multiple ports from Docker within Elastic Beanstalk


Thanking you in advance





Aucun commentaire:

Enregistrer un commentaire