Skip to content

Commit

Permalink
Added Dockerfile, docker compose watch configuration and updated READ…
Browse files Browse the repository at this point in the history
…ME with instructions.
  • Loading branch information
nilshoffmann committed Jan 30, 2024
1 parent da0bd61 commit 6d0cba1
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM python:3.9-slim

WORKDIR /app

RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*

RUN adduser --shell /bin/bash -uid 1002 app
USER app
COPY --chown=app:app requirements.txt requirements.txt

USER root
RUN pip3 install -U pip
RUN pip3 install -r requirements.txt

USER app
COPY --chown=app:app . .

EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

ENTRYPOINT ["streamlit", "run", "Home.py", "--server.port=8501", "--server.address=0.0.0.0"]
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ The parsed ontologies used in the streamlit app are in the data folder. Every to
To start the app locally you run: ** streamlit run Home.py **
This will then open the Home screen of the app. The following steps can be found in the pages folder and are numbered accordingly.

Alternatively, during development, you can use docker compose to build and run the app using the `watch` feature locally:

```bash
docker compose up --watch
```

This will automatically sync file changes from your local machine to the docker container. Streamlit will automatically pick up file changes and will offer to reload the application.

Open your browser and go to http://localhost:8501 to see the app running.

### lesSDRF v0.1.0 has the following ontologies incorporated:<br>

Streamlit version 1.19.0 and Python version 3.9.13<br>
Expand Down
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3.7'
services:
lessdrf:
#env_file:
# - .env
build:
context: .
dockerfile: Dockerfile
develop:
watch:
- action: sync
path: .
target: /app
ignore:
- __pycache__
- Dockerfile
- action: rebuild
path: Dockerfile
image: lessdrf
container_name: lessdrf
restart: on-failure
ports:
- 8501:8501
networks:
- network
networks:
network:
driver: bridge

0 comments on commit 6d0cba1

Please sign in to comment.