Skip to content

Commit

Permalink
Merge branch 'release/flask_example_v2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
tsungtwu committed Apr 28, 2017
2 parents 4a1a4c8 + fc2571a commit 8f40bf8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This dockerfile use to dockerize flask application
# VERSION 1
# MAINTAINER tsungtwu jtrmn.wu@gmail.com

FROM python:2.7-onbuild

ARG CONFIG=development
ENV FLASK_CONFIG ${CONFIG}


# RUN mkdir /flask
WORKDIR /flask

# Install lib
COPY ./requirements.txt ./
COPY ./webapp /flask

RUN pip install -r requirements.txt



ENTRYPOINT ["gunicorn"]
CMD ["-w", "4", "-b", "0.0.0.0:5000","run:app"]
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,19 @@ $ gunicorn -w 4 -b 127.0.0.1:5000 run:app
* -w : number of worker
* -b : Socket to bind


### Run with Docker

```
$ docker build -t flask-example .
$ docker run -p 5000:5000 --name flask-example flask-example
```

In image building, the webapp folder will also add into the image


## Unittest
```
$ nosetests webapp/ --with-cov --cover-html --cover-package=app
Expand Down Expand Up @@ -150,6 +163,8 @@ Tutorial


## Changelog

- Version 2.3 : add dockerfile
- Version 2.2 : add ESDAO module
- Version 2.1 : add OAuth extension: FLASK-OAuth, and google oauth example
- Version 2.0 : add SQL ORM extension: FLASK-SQLAlchemy
Expand Down

0 comments on commit 8f40bf8

Please sign in to comment.