Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ubuntu:18.04

RUN apt-get update && \
apt-get install -y python3 python3-pip

WORKDIR /usr/src/app

COPY . .

RUN pip3 install -r requirements/prod.txt

ENV FLASK_APP time_tracker_api

EXPOSE 5000

CMD ["gunicorn", "-b 0.0.0.0:5000", "run:app"]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,20 @@ as well as its correspondent options.
python cli.py gen_swagger_json -f ~/Downloads/swagger.json
```

## Run as docker container

1. Build image
```bash
docker build -t time_tracker_api:local .
```

2. Run app
```bash
docker run -p 5000:5000 time_tracker_api:local
```

3. Visit `127.0.0.1:5000`

## Built with
- [Python version 3](https://www.python.org/download/releases/3.0/) as backend programming language. Strong typing for
the win.
Expand Down
3 changes: 3 additions & 0 deletions requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ gunicorn==20.0.4
#Swagger support for Restful API
flask-restplus==0.13.0

#Mocking
Faker==4.0.2

#CLI support
Flask-Script==2.0.6