Skip to content

Commit c815177

Browse files
authored
Merge pull request imfing#3 from xtellurian/master
Adding Docker support
2 parents f03b7e2 + 36e58ca commit c815177

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM ubuntu:16.04
2+
3+
# Install Python.
4+
RUN \
5+
apt-get update && \
6+
apt-get install -y python python-dev python-pip python-virtualenv && \
7+
rm -rf /var/lib/apt/lists/*
8+
9+
WORKDIR app
10+
11+
# reqs from file, to speed up dev iteration
12+
RUN pip install Werkzeug Flask numpy Keras gevent pillow h5py tensorflow
13+
14+
COPY . .
15+
16+
RUN pip install -r requirements.txt
17+
18+
ENTRYPOINT [ "python" , "app.py"]

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,24 @@
2323

2424
------------------
2525

26-
## Installation
26+
## Docker Installation
27+
28+
Build the image
29+
30+
```shell
31+
cd keras-flask-deploy-webapp
32+
docker build -t keras_flask .
33+
docker run -e MODEL_PATH=models/your_model.h5 -p 5000:5000
34+
```
35+
36+
You can mount your model into the container.
37+
38+
```shell
39+
docker run -e MODEL_PATH=/mnt/models/your_model.h5 -v volume-name:/mnt/models -p 5000:5000 keras_flask
40+
```
41+
42+
43+
## Local Installation
2744

2845
### Clone the repo
2946
```shell

0 commit comments

Comments
 (0)