Skip to content

Commit

Permalink
Add docker compose and instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
edurenye committed Oct 6, 2023
1 parent 464f4bb commit 9a99267
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 2 deletions.
48 changes: 48 additions & 0 deletions README.md
Expand Up @@ -18,3 +18,51 @@ docker run -it -p 10300:10300 -v /path/to/local/data:/data rhasspy/wyoming-whisp
``` sh
docker run -it -p 10200:10200 -v /path/to/local/data:/data rhasspy/wyoming-piper --voice en_US-lessac-medium
```

## To run in standalone server

### Run without GPU

Build openwakeword, piper and whisper without GPU with:

``` sh
docker compose -f docker-compose.base.yml build --no-cache
```

Run it with:

``` sh
docker composer -f docker-compose.base.yml up -d
```

Take it down with:

``` sh
docker composer down
```

### Run with GPU

Build openwakeword, piper and whisper with GPU with:

``` sh
docker compose -f docker-compose.gpu.yml build --no-cache
```

Run it with:

``` sh
docker composer -f docker-compose.gpu.yml up -d
```

Take it down with:

``` sh
docker composer down
```

### Extend it

You can extend those files adding your own languages.
More on docker compose extend in the [official documentation](https://docs.docker.com/compose/multiple-compose-files/extends/).

35 changes: 35 additions & 0 deletions docker-compose.base.yml
@@ -0,0 +1,35 @@
version: '3'
services:
wyoming-piper:
build:
context: ./piper/
dockerfile: NONGPU.Dockerfile
ports:
- "10200:10200"
volumes:
- ./piper-data:/data
command: [ "--voice", "en_US-lessac-medium" ]
restart: unless-stopped

wyoming-whisper:
build:
context: ./whisper/
dockerfile: NONGPU.Dockerfile
ports:
- "10300:10300"
volumes:
- ./whisper-data:/data
command: [ "--model", "tiny-int8", "--language", "en" ]
restart: unless-stopped

wyoming-openwakeword:
build:
context: ./openwakeword/
dockerfile: NONGPU.Dockerfile
ports:
- "10400:10400"
volumes:
- ./openwakeword-data:/data
command: [ "--model", "hey_jarvis" ]
restart: unless-stopped

44 changes: 44 additions & 0 deletions docker-compose.gpu.yml
@@ -0,0 +1,44 @@
version: '3'
services:
wyoming-piper:
extends:
file: docker-compose.base.yml
service: wyoming-piper
build:
dockerfile: GPU.Dockerfile
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]

wyoming-whisper:
extends:
file: docker-compose.base.yml
service: wyoming-whisper
build:
dockerfile: GPU.Dockerfile
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]

wyoming-openwakeword:
extends:
file: docker-compose.base.yml
service: wyoming-openwakeword
build:
dockerfile: GPU.Dockerfile
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]

2 changes: 1 addition & 1 deletion piper/GPU.Dockerfile
Expand Up @@ -32,4 +32,4 @@ COPY run-gpu.sh ./

EXPOSE 10200

ENTRYPOINT ["bash", "/run.sh"]
ENTRYPOINT ["bash", "/run-gpu.sh"]
2 changes: 1 addition & 1 deletion piper/NONGPU.Dockerfile
Expand Up @@ -31,4 +31,4 @@ COPY run-nongpu.sh ./

EXPOSE 10200

ENTRYPOINT ["bash", "/run.sh"]
ENTRYPOINT ["bash", "/run-nongpu.sh"]

0 comments on commit 9a99267

Please sign in to comment.