Skip to content

Commit fcc0e3c

Browse files
authored
Merge pull request #34 from ioet/feature/dockerize-app#28
Dockerize app
2 parents 9e598c4 + 2f095e1 commit fcc0e3c

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM python:3.8-alpine
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY . .
6+
7+
RUN pip3 install -r requirements/prod.txt
8+
9+
ENV FLASK_APP time_tracker_api
10+
11+
EXPOSE 5000
12+
13+
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 `127.0.0.1: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)