diff --git a/.dockerignore b/.dockerignore index 255f49d..fbee7eb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ .env -.git \ No newline at end of file +.git +Dockerfile \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 0340136..821fefd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,21 @@ -FROM python:3.9-slim-bullseye AS compile-image - -RUN apt-get update -y && apt-get install -y python3-pip git - -RUN pip3 install --user torch --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu +FROM python:3.9-slim AS compile-image COPY . /tmp/neon-tts-plugin-coqui -RUN pip3 install --user /tmp/neon-tts-plugin-coqui --no-cache-dir - -RUN pip3 install --user git+https://github.com/OpenVoiceOS/ovos-tts-server@b9ee84c48ab6ab5655fffa032359752ab10d2c9d +RUN pip install wheel && \ + pip install --user --no-cache-dir \ + /tmp/neon-tts-plugin-coqui/[docker] --extra-index-url https://download.pytorch.org/whl/cpu -FROM python:3.9-slim-bullseye AS build-image - -RUN apt-get update -y && apt-get install -y --no-install-recommends espeak-ng +# Copy built packages to a clean image to exclude build-time extras from final image +FROM python:3.9-slim AS build-image COPY --from=compile-image /root/.local /root/.local ENV PATH=/root/.local/bin:$PATH -ENTRYPOINT ovos-tts-server --engine coqui \ No newline at end of file +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + espeak-ng + +ENTRYPOINT ovos-tts-server --engine coqui --gradio \ +--title "πŸΈπŸ’¬ - NeonAI Coqui AI TTS Plugin" \ +--description "πŸΈπŸ’¬ - a deep learning toolkit for Text-to-Speech, battle-tested in research and production" \ +--info "more info at [Neon Coqui TTS Plugin](https://github.com/NeonGeckoCom/neon-tts-plugin-coqui), [Coqui TTS](https://github.com/coqui-ai/TTS)" \ +--badge "https://visitor-badge-reloaded.herokuapp.com/badge?page_id=neongeckocom.neon-tts-plugin-coqui" \ No newline at end of file diff --git a/requirements/docker.txt b/requirements/docker.txt new file mode 100644 index 0000000..988ad07 --- /dev/null +++ b/requirements/docker.txt @@ -0,0 +1 @@ +ovos-tts-server>=0.0.3a5 \ No newline at end of file diff --git a/requirements/requirements.txt b/requirements/requirements.txt index afecd60..bc556e3 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -3,6 +3,10 @@ numpy>=1.19.5 torch~=1.9,!=1.13.0 # dependencies ovos-plugin-manager~=0.0.2 +ovos-utils~=0.0.32 psutil # huggingface -huggingface-hub \ No newline at end of file +huggingface-hub + +mycroft-messagebus-client~=0.10 +# TODO: Above patching OPM dependency \ No newline at end of file diff --git a/setup.py b/setup.py index 0f1aeae..9360345 100644 --- a/setup.py +++ b/setup.py @@ -31,19 +31,23 @@ def get_requirements(requirements_filename: str): - requirements_file = path.join(path.abspath(path.dirname(__file__)), "requirements", requirements_filename) + requirements_file = path.join(path.abspath(path.dirname(__file__)), + "requirements", requirements_filename) with open(requirements_file, 'r', encoding='utf-8') as r: requirements = r.readlines() - requirements = [r.strip() for r in requirements if r.strip() and not r.strip().startswith("#")] + requirements = [r.strip() for r in requirements if r.strip() and not + r.strip().startswith("#")] for i in range(0, len(requirements)): r = requirements[i] if "@" in r: - parts = [p.lower() if p.strip().startswith("git+http") else p for p in r.split('@')] + parts = [p.lower() if p.strip().startswith("git+http") else p + for p in r.split('@')] r = "@".join(parts) if getenv("GITHUB_TOKEN"): if "github.com" in r: - r = r.replace("github.com", f"{getenv('GITHUB_TOKEN')}@github.com") + r = r.replace("github.com", + f"{getenv('GITHUB_TOKEN')}@github.com") requirements[i] = r return requirements @@ -74,6 +78,7 @@ def get_requirements(requirements_filename: str): license='BSD-3.0', packages=find_packages(), install_requires=get_requirements("requirements.txt"), + extras_require={"docker": get_requirements("docker.txt")}, zip_safe=True, classifiers=[ 'Intended Audience :: Developers',