Skip to content

Commit

Permalink
created the yml file for running on AWS :shipit:
Browse files Browse the repository at this point in the history
  • Loading branch information
prakhar1989 committed Jan 9, 2016
1 parent d517f1f commit 4577425
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
venv
.DS_Store
elasticsearch
*.pem
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ This is a fun application built to accompany the [docker curriculum](http://prak

If you find the design of the website a bit ostentatious, blame [Genius](http://genius.com) for giving me the idea of using this color scheme. Lastly, the data for the food trucks is made available in public domain by [SF Data](https://data.sfgov.org/Economy-and-Community/Mobile-Food-Facility-Permit/rqzj-sfat).

### Running
#### Docker

There are two different ways of getting the app up and running. To learn more how these two differ, checkout the [docker curriculum](http://prakhar.me/docker-curriculum).
There are two different ways of getting the app up and running with Docker. To learn more how these two differ, checkout the [docker curriculum](http://prakhar.me/docker-curriculum).

##### Docker Network
```
Expand Down
12 changes: 12 additions & 0 deletions aws-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
es:
image: elasticsearch
cpu_shares: 100
mem_limit: 524288000
web:
image: prakhar1989/foodtrucks-web
cpu_shares: 100
mem_limit: 524288000
ports:
- "80:5000"
links:
- es
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
es:
image: elasticsearch
web:
build: .
image: prakhar1989/foodtrucks-web
command: python app.py
ports:
- "5000:5000"
Expand Down
2 changes: 1 addition & 1 deletion flask-app/static/build/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion flask-app/static/build/main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions flask-app/static/src/components/Intro.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ var Intro = React.createClass({
<p>This is a fun application built to accompany the <a href="http://prakhar.me/docker-curriculum">docker curriculum</a> - a comprehensive tutorial on getting started with Docker
targeted especially at beginners.</p>
<p>The app is built with Flask on the backend and Elasticsearch is the engine powering the search.</p>
<p>The frontend is built with React and the beautiful maps are courtesy of Mapbox.</p>
<p>If you find the design a bit ostentatious, blame <a href="http://genius.com/Justin-bieber-baby-lyrics">Genius</a> for giving me the idea of using this color scheme. If you love it, all the credit goes to me. ⊂(▀¯▀⊂)</p>
<p>The frontend is hand-crafted with React and the beautiful maps are courtesy of Mapbox.</p>
<p>If you find the design a bit ostentatious, blame <a href="http://genius.com/Justin-bieber-baby-lyrics">Genius</a> for giving me the idea of using this color scheme. If you love it, I smugly take all the credit. ⊂(▀¯▀⊂)</p>
<p>Lastly, the data for the food trucks is made available in public domain by <a href="https://data.sfgov.org/Economy-and-Community/Mobile-Food-Facility-Permit/rqzj-sfat">SF Data</a></p>
</div>
)
Expand Down
13 changes: 13 additions & 0 deletions setup-aws-ecs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# configure
ecs-cli configure --region us-east-1 --cluster foodtrucks

# setup cloud formation template
ecs-cli up --keypair ecs --capability-iam --size 2 --instance-type t2.medium

# deploy
ecs-cli compose --file aws-compose.yml up

# check
ecs-cli ps
4 changes: 2 additions & 2 deletions setup-docker.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# build the flask container
docker build -t prakhar1989/flask-app .
docker build -t prakhar1989/foodtrucks-web .

# create the network
docker network create foodtrucks
Expand All @@ -10,4 +10,4 @@ docker network create foodtrucks
docker run -d --net foodtrucks -p 9200:9200 -p 9300:9300 --name es elasticsearch

# start the flask app container
docker run -d --net foodtrucks -p 5000:5000 --name flask-app prakhar1989/flask-app
docker run -d --net foodtrucks -p 5000:5000 --name foodtrucks-web prakhar1989/foodtrucks-web

0 comments on commit 4577425

Please sign in to comment.