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".
- Pick an application name.
- Environment tier: Web Server
- Predefined Configuration: Docker
- Environment type: Load balancing, autoscaling
- On the next screen select Upload your own and find the zip you created.
- Additional Resources. Next.
- Configuration Details. Next.
- Environtment Tags. Next.
- 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