Skip to content

Commit 0297215

Browse files
committed
add a Dockerfile
1 parent 967d3b6 commit 0297215

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-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.7
2+
3+
EXPOSE 5000
4+
5+
WORKDIR /app
6+
7+
ADD requirements.txt /app/
8+
RUN pip3 install https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_x86_64.whl
9+
RUN pip install -r requirements.txt
10+
11+
ADD . /app
12+
13+
CMD [ "uvicorn", "tflite-server:app", "--reload", "--port", "5000", "--host", "0.0.0.0" ]

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ Start the tflite-server on port 5000 :
2323
(venv) $ uvicorn tflite-server:app --reload --port 5000 --host 0.0.0.0
2424
```
2525

26+
Or via Docker:
27+
28+
```
29+
# Build
30+
docker build -t tensorflow-lite-rest-server .
31+
# Run
32+
docker run -p 5000:5000 tensorflow-lite-rest-server:latest
33+
```
34+
2635
You can check that the tflite-server is running by visiting `http://ip:5000/` from any machine, where `ip` is the ip address of the host (`localhost` if querying from the same machine). The docs can be viewed at `http://localhost:5000/docs`
2736

2837
Post an image to detecting objects via cURL:

0 commit comments

Comments
 (0)