diff --git a/Dockerfile b/Dockerfile index c5128a3..566b1b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,12 +11,14 @@ EXPOSE 8000 # set poetry environment variables ARG POETRY_FLAGS="--only main" ARG LOAD_NER_MODELS="False" +ARG HOST_FLAVOR="default" # set default environment variables ENV OLLAMA_BASE_URL=http://localhost:11434 \ OLLAMA_MODEL=llama3.2:latest \ DEBIAN_FRONTEND=noninteractive \ - HTTPX_CLIENT_VERIFY= + HTTPX_CLIENT_VERIFY= \ + HOST_FLAVOR=$HOST_FLAVOR # add app src COPY . /app/ diff --git a/Makefile b/Makefile index 27809c2..85510d4 100644 --- a/Makefile +++ b/Makefile @@ -63,8 +63,13 @@ dev: $(INSTALL_STAMP) # Run target to execute the application for production run: $(INSTALL_STAMP) # $(POETRY) run gunicorn src.app:app --workers 4 --worker-class uvicorn.workers.UvicornWorker + @echo "default mode" $(POETRY) run uvicorn src.app:app --host 0.0.0.0 --port 8000 +runos: $(INSTALL_STAMP) + @echo "openshift mode" + /home/anon/.local/bin/poetry run uvicorn src.app:app --host 0.0.0.0 --port 8000 + loadModels: $(INSTALL_STAMP) $(POETRY) run python src/utils/ano_spacy.py loadModels \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 5d78915..5e22b9b 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,11 +1,19 @@ -#!/bin/sh +#!/bin/bash # Execute the command passed to the container echo "$(cat banner.txt)" +# Define your dictionary as an associative array +declare -A flavor + +# Add key-value pairs +flavor["openshift"]="make runos" +flavor["default"]="make run" + if [ -z "$@" ]; then export PATH="$HOME/.local/bin:$PATH" - make run + echo "starting with flavor: $HOST_FLAVOR" + eval "${flavor[$HOST_FLAVOR]}" fi # Execute the command passed to the container diff --git a/src/templates/html/mask.html b/src/templates/html/mask.html index d05b98b..6ae4748 100644 --- a/src/templates/html/mask.html +++ b/src/templates/html/mask.html @@ -94,7 +94,11 @@

Masked text