Skip to content

Commit

Permalink
Add description for installment on an ec2 instance
Browse files Browse the repository at this point in the history
  • Loading branch information
svenstm committed Jun 15, 2018
1 parent 7d9b227 commit 645a5b4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,34 @@ destory the mongodb container all your data will be lost.

docker-compose up

Docker compose is configured to run the node on a local machine. If you are running the node a hosted machine and it needs
to be accessible over to internet you will have to change the port mapping in the `docker-compose.yml` to
Docker compose is configured to run the node on a local machine on port 80. If you would like to run the node on different
port you will need to change the `docker-compose.yml` to

ports:
- "80:3000"
- "<your-port>:3000"

This way the node will be accessible via port 80.

Or you can use a reverse proxy like NGINX to make the node publicly available. This is highly recommended.

Run on EC2
---

To Run the not on a AWS EC2 instance we have included an install script will bootstrap your ec2 instance. To use this script
you will need to select the following AMI: ami-c91624b0.

So to run a node on a EC2 instance you can perform the following steps:

1. Click "Launch Instance" and select ami-c91624b0 from the 'Community AMIs'
2. Select an instance type, currently a t2.micro is sufficient.
3. Configure instance, here 2 things are important.
- The node requires a public ip
- Under the "Advanced Details" tab you need to upload the provided `install_ec2.sh` file (this will installed the node)
4. Adding storage is different depending on whether you will run an external mongo service. If you choose the default, select
atleast 15 Gb of storage.
5. For the security group make sure the node can be accessed on port 80
6. You are ready to run launch the instance.

Run in AWS Elastic Beanstalk
---
Running the node using AWS Elastic Beanstalk (EB) it will only install the services on a machine. You will have to provide
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
container_name: webserver
image: legalthings/webserver
ports:
- "3000:3000"
- "80:3000"
networks:
- lto

Expand Down
10 changes: 10 additions & 0 deletions install_ec2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
yum install -y wget
cd /tmp
wget -O lto.tar.gz https://github.com/legalthings/lto/archive/v0.2.0.tar.gz
tar -xvf lto.tar.gz
mv lto-0.2.0/docker-compose.yml .
curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

su - ec2-user -c 'docker-compose -f /tmp/docker-compose.yml up -d'

0 comments on commit 645a5b4

Please sign in to comment.