Skip to content

Commit

Permalink
added file for docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
prakhar1989 committed Jan 8, 2016
1 parent cb73265 commit d517f1f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,14 @@ If you find the design of the website a bit ostentatious, blame [Genius](http://

### Running

Running it manually -
```
# build the flask container
$ docker build -t prakhar1989/flask-app .
# create the network
$ docker network create foodtrucks
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).

# start the ES container
$ 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 Network
```
$ ./setup-docker.sh
```

Using Docker Compose -
##### Docker Compose
```
$ docker-compose up
```
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
es:
image: elasticsearch
web:
build: .
command: python app.py
ports:
- "5000:5000"
volumes:
- .:/code
links:
- es
10 changes: 3 additions & 7 deletions setup-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
docker build -t prakhar1989/flask-app .

# create the network
docker network create es
docker network create foodtrucks

# start the ES container
docker run -d --net es -p 9200:9200 -h es-primary --name es-primary elasticsearch

# index the documents
python load_data.py -i "0.0.0.0" -p "9200"
docker run -d --net foodtrucks -p 9200:9200 -p 9300:9300 --name es elasticsearch

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

docker run -d --net foodtrucks -p 5000:5000 --name flask-app prakhar1989/flask-app

0 comments on commit d517f1f

Please sign in to comment.