diff --git a/.dockerignore b/.dockerignore index ccbef6a..1f9c96d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,15 @@ -.venv .env -**/.cache .git -**/__pycache__ +__pycache__ +.cache +.mypy_cache +.pytest_cache +.ipynb_checkpoints +.gitignore .dockerignore +Dockerfile +.github +.vscode +docs +scripts +tests diff --git a/.gitignore b/.gitignore index cdadf66..139f214 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,5 @@ __pycache__ .cache .mypy_cache .pytest_cache -**/.ipynb_checkpoints -**/tracing_database.json +.ipynb_checkpoints *.egg-info diff --git a/Dockerfile b/Dockerfile index a2156d7..0572c37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,26 @@ FROM python:3.10.4-slim-bullseye +LABEL org.opencontainers.image.title="GreatAI package wrapper container" +LABEL org.opencontainers.image.vendor="ScoutinScience B.V." +LABEL org.opencontainers.image.authors="andras@schmelczer.dev" +LABEL org.opencontainers.image.source="https://github.com/ScoutinScience/great_ai" + ENV ENVIRONMENT production +EXPOSE 6060 -ARG ENTRYPOINT main.py - -WORKDIR /app - -RUN apt-get update &&\ - apt-get install curl -y &&\ +RUN DEBIAN_FRONTEND=noninteractive apt update &&\ + apt install curl -y &&\ rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir en-core-web-sm@https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.3.0/en_core_web_sm-3.3.0-py3-none-any.whl -COPY great_ai great_ai -RUN pip install --no-cache-dir ./great_ai +COPY . great_ai +RUN pip3 install --no-cache-dir ./great_ai &&\ + rm -rf great_ai -# COPY requirements.txt ./ -# RUN pip install --no-cache-dir --requirement requirements.txt - -COPY . . -RUN rm -rf great_ai - -EXPOSE 6060 +RUN pip3 install --no-cache-dir en-core-web-sm@https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.3.0/en_core_web_sm-3.3.0-py3-none-any.whl HEALTHCHECK --interval=60s --timeout=60s --start-period=90s --retries=5 CMD [ "curl", "--fail", "http://localhost:6060/health" ] -CMD ["great_ai", "$ENTRYPOINT"] +WORKDIR /app +VOLUME /app + +ENTRYPOINT ["/bin/sh", "python3", "-m", "great_ai"] diff --git a/example_secrets.ini b/docs/example_secrets.ini similarity index 100% rename from example_secrets.ini rename to docs/example_secrets.ini diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 0ac00d1..0000000 --- a/requirements.txt +++ /dev/null @@ -1,23 +0,0 @@ -click < 8.1.0 -unidecode >= 1.3.0 -multiprocess >= 0.70.0.0 -tqdm >= 4.0.0 -psutil >= 5.9.0 -beautifulsoup4 >= 4.10.0 -lxml >= 4.6.0 -spacy >= 3.3.0 -pydantic >= 1.8.0 -scikit-learn == 1.1.1 -matplotlib >= 3.5.0 -numpy >= 1.22.0 -langcodes[data] >= 3.3.0 -segtok >= 1.5.11 -langdetect >= 1.0.9 -tinydb >= 4.7.0 -pandas >= 1.4.0 -pyaml >= 21.0.0 -boto3 >= 1.23.0 -fastapi >= 0.70.0 -plotly >= 5.8.0 -dash >= 2.4.0 -uvicorn[standard] >= 0.17.0