Skip to content

Instantly share code, notes, and snippets.

@get-data-
Created June 28, 2017 21:01
Show Gist options
  • Save get-data-/8007b6dc830ef5df4df56e1b56c4f86f to your computer and use it in GitHub Desktop.
Save get-data-/8007b6dc830ef5df4df56e1b56c4f86f to your computer and use it in GitHub Desktop.
https://github.com/julianespinel/stockreader/wiki/Deploy-to-AWS-using-docker-machine-and-docker-compose
Deploy to AWS using docker-machine and docker-compose
1. Prepare your machine
Please follow this steps:
Install docker in your localhost. Installation link
Install docker-machine in your localhost. Installation link
Install docker-compose in your localhost. Installation link
Create an account in AWS (skip this step if you already have one). AWS
Create the AWS credentials file in your localhost. docker-machine + aws
Log into aws and get your VPC ID
Go to: https://console.aws.amazon.com/vpc/
Click on the VPC link
Copy your VPC ID
2. Deploy to AWS
Please write this commands in your terminal:
docker-machine create -d amazonec2 --amazonec2-vpc-id <your-vpc-id> --amazonec2-ami ami-e13739f6 stockreader
docker-machine env stockreader
eval $(docker-machine env stockreader)
(From now on all docker, docker-machine and docker-compose commands will point to the AWS EC2 instance)
git clone https://github.com/julianespinel/stockreader.git (clone the project in your localhost)
cd stockreader
docker-compose build
docker-compose up -d
3. Check Stockreader is up and running
Please follow this steps:
Go to your AWS EC2
Click on the "running instances" link
Copy the public IP of the stockreader instance
Check the security group applied to the instance allows inbound TCP traffic to the port 5000
On your browser go to:
http://<stockreader-instance-public-ip>:5000/stockreader/admin/ping
If you get the following JSON, congratulations! You just deployed Stockreader to AWS using docker-machine and docker compose:
{
"message": "pong"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment