diff --git a/Dockerfile b/Dockerfile index 183167b..6c83bdc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,28 @@ FROM python:3.11-slim -# Install system dependencies +# Install system dependencies #TODO: no git or gcc should be needed inside container -or just uninstall later - just provide a pre build lc3 package from a inhouse pip source RUN apt-get update && apt-get install -y \ - liblc3-tools \ - && rm -rf /var/lib/apt/lists/* + git gcc +# liblc3-tools \ +# && rm -rf /var/lib/apt/lists/* WORKDIR /app # Copy project files COPY . . +# accept new ssh server +RUN sed /^StrictHostKeyChecking/d /etc/ssh/ssh_config; \ +echo StrictHostKeyChecking no >> /etc/ssh/ssh_config + # Install Python dependencies -RUN --mount=type=cache,target=/root/.cache pip install --no-cache-dir . +RUN --mount=type=cache,target=/root/.cache \ + --mount=type=ssh,required=true \ + pip install --no-cache-dir . + # dependencies for running piper on gpu RUN --mount=type=cache,target=/root/.cache pip install --no-cache-dir onnxruntime-gpu - # Expose the API port EXPOSE 7999 diff --git a/docker-compose.yml b/docker-compose.yml index a89cca7..9f011e6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,10 +3,18 @@ services: build: context: . dockerfile: Dockerfile + ssh: + - default=~/.ssh/id_ed25519 #lappi ports: - "7999:7999" environment: - PYTHONUNBUFFERED=1 restart: unless-stopped - networks: - - translator-network + + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: 1 + capabilities: [gpu] diff --git a/pyproject.toml b/pyproject.toml index 64e89b9..1ce886e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,8 @@ dependencies = [ "requests==2.32.3", "aiohttp==3.9.3", "piper-tts==1.2.0", - "librosa==0.10.1" + "librosa==0.10.1", + "lc3 @ git+ssh://git@ssh.pstruebi.xyz:222/auracaster/liblc3.git@7558637303106c7ea971e7bb8cedf379d3e08bcc", ] [project.optional-dependencies]