mardi 31 mars 2015

Running a Docker container on AWS Elastic Beanstalk - Where is my web app?

Dockerfile



FROM ubuntu:14.04

RUN apt-get update && apt-get upgrade -y

RUN apt-get install -y git git-core wget zip nodejs npm

EXPOSE 8080

# startup
ADD start.sh /tmp/
RUN chmod +x /tmp/start.sh
CMD ./tmp/start.sh


start.sh



cd /tmp

rm -rf docker-node-test; true

git clone http://ift.tt/1CIxOpu

cd docker-node-test

npm install

nodejs app.js


Dockerrun.aws.json



{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "ubuntu:14.04"
},
"Ports": [
{
"ContainerPort": "8080"
}
]
}


Before I hit the beanstalk I put 3 files into a .zip file. Call it aws-test.zip


Head to the AWS developer console and select "Elastic Beanstalk". Then pick "Create New Application".



  1. Pick an application name.

  2. Environment tier: Web Server

  3. Predefined Configuration: Docker

  4. Environment type: Load balancing, autoscaling

  5. On the next screen select Upload your own and find the zip you created.

  6. Additional Resources. Next.

  7. Configuration Details. Next.

  8. Environtment Tags. Next.

  9. Scroll down and click Launch.


It always shows web page :



Congratulations!
Your Docker Container is now running in Elastic Beanstalk on your own dedicated environment in the AWS Cloud


Where is my web app? Do i miss anything?





Aucun commentaire:

Enregistrer un commentaire