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 16, 2023
1 parent bfdc7fb commit 48f4a98
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 2 deletions.
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,58 @@ docker run -it -p 10300:10300 -v /path/to/local/data:/data rhasspy/wyoming-whisp
docker run -it -p 10200:10200 -v /path/to/local/data:/data rhasspy/wyoming-piper --voice en_US-lessac-medium
```


## Run openWakeWord

``` sh
docker run -it -p 10400:10400 rhasspy/wyoming-openwakeword --preload-model 'ok_nabu'
```


## 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 compose -f docker-compose.base.yml up -d
```

Take it down with:

``` sh
docker compose 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 compose -f docker-compose.gpu.yml up -d
```

Take it down with:

``` sh
docker compose 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
Original file line number Diff line number Diff line change
@@ -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: [ "--preload-model", "hey_jarvis" ]
restart: unless-stopped

44 changes: 44 additions & 0 deletions docker-compose.gpu.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 48f4a98

Please sign in to comment.