Skip to content

Commit 15c494e

Browse files
committed
Fixes #28 - Add dockerfile, update Readme
1 parent 9e598c4 commit 15c494e

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM ubuntu:18.04
2+
3+
RUN apt-get update && \
4+
apt-get install -y python3 python3-pip
5+
6+
WORKDIR /usr/src/app
7+
8+
COPY . .
9+
10+
RUN pip3 install -r requirements/prod.txt
11+
12+
ENV FLASK_APP time_tracker_api
13+
14+
EXPOSE 5000
15+
16+
CMD ["gunicorn", "-b 0.0.0.0:5000", "run:app"]

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,20 @@ as well as its correspondent options.
111111
python cli.py gen_swagger_json -f ~/Downloads/swagger.json
112112
```
113113

114+
## Run as docker container
115+
116+
1. Build image
117+
```bash
118+
docker build -t time_tracker_api:local .
119+
```
120+
121+
2. Run app
122+
```bash
123+
docker run -p 5000:5000 time_tracker_api:local
124+
```
125+
126+
3. Visit `0.0.0.0:5000`
127+
114128
## Built with
115129
- [Python version 3](https://www.python.org/download/releases/3.0/) as backend programming language. Strong typing for
116130
the win.

requirements/prod.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@ gunicorn==20.0.4
1515
#Swagger support for Restful API
1616
flask-restplus==0.13.0
1717

18+
#Mocking
19+
Faker==4.0.2
20+
1821
#CLI support
1922
Flask-Script==2.0.6

0 commit comments

Comments
 (0)