Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Commit

Permalink
initial docker
Browse files Browse the repository at this point in the history
  • Loading branch information
robmarkcole committed Jun 7, 2020
1 parent 4b005ad commit d35889c
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 13 deletions.
21 changes: 10 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
FROM python:3.7-slim-stretch
FROM python:3.8
LABEL maintainer="Robin Cole @robmarkcole"

RUN apt-get update && apt-get install -y git python3-dev gcc \
&& rm -rf /var/lib/apt/lists/*
EXPOSE 8501

COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install -r requirements.txt

RUN pip install --upgrade -r requirements.txt
RUN mkdir -p /app
COPY app /app
WORKDIR /app

COPY app app/

RUN python app/server.py

EXPOSE 5000

CMD ["python", "app/server.py", "serve"]
ENTRYPOINT [ "streamlit", "run"]
CMD ["streamlit-ui.py"]
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ venv/bin/streamlit run streamlit-ui.py
<img src="https://github.com/robmarkcole/deepstack-ui/blob/master/usage.png" width="800">
</p>

## Run with Docker
From the root dir, build from source:
```
docker build -t deepstack-ui .
docker run -p 8501:8501 -e DEEPSTACK_IP='192.168.1.133' deepstack-ui:latest
```

Alternatively run the pre-built image: `docker run -p 8501:8501 -e DEEPSTACK_IP='192.168.1.133' robmarkcole/deepstack-ui:latest`

Then visit [localhost:8501](http://localhost:8501/)

## Development
Use venv:
```
Expand Down
File renamed without changes.
File renamed without changes
4 changes: 2 additions & 2 deletions streamlit-ui.py → app/streamlit-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import const

## Depstack setup
DEEPSTACK_IP_ADDRESS = "localhost"
DEEPSTACK_IP = os.getenv("DEEPSTACK_IP", "set-your-deepstack-ip")
DEEPSTACK_PORT = "5000"
DEEPSTACK_API_KEY = ""
DEEPSTACK_TIMEOUT = 20 # Default is 10
Expand Down Expand Up @@ -46,7 +46,7 @@ def process_image(pil_image, dsobject):
pil_image = Image.open(TEST_IMAGE)

dsobject = ds.DeepstackObject(
DEEPSTACK_IP_ADDRESS, DEEPSTACK_PORT, DEEPSTACK_API_KEY, DEEPSTACK_TIMEOUT
DEEPSTACK_IP, DEEPSTACK_PORT, DEEPSTACK_API_KEY, DEEPSTACK_TIMEOUT
)

predictions, summary = process_image(pil_image, dsobject)
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes.

0 comments on commit d35889c

Please sign in to comment.