Skip to content

Commit 70befc1

Browse files
committed
Update Dockerfiles and dependencies for multi-architecture support with optional extras for Torch CPU and GPU env
1 parent 636cea3 commit 70befc1

File tree

6 files changed

+216
-41
lines changed

6 files changed

+216
-41
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ ENV PATH="${PATH}:${POETRY_VENV}/bin"
1414

1515
WORKDIR /app
1616

17-
COPY . /app
17+
COPY . .
1818
COPY --from=ffmpeg /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
1919
COPY --from=swagger-ui /usr/share/nginx/html/swagger-ui.css swagger-ui-assets/swagger-ui.css
2020
COPY --from=swagger-ui /usr/share/nginx/html/swagger-ui-bundle.js swagger-ui-assets/swagger-ui-bundle.js
2121

2222
RUN poetry config virtualenvs.in-project true
23-
RUN poetry install
23+
RUN poetry install --extras cpu
2424

2525
EXPOSE 9000
2626

Dockerfile.gpu

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,14 @@ ENV PATH="${PATH}:${POETRY_VENV}/bin"
3030

3131
WORKDIR /app
3232

33-
COPY poetry.lock pyproject.toml ./
34-
35-
RUN poetry config virtualenvs.in-project true
36-
RUN poetry install --no-root
37-
3833
COPY . .
3934
COPY --from=ffmpeg /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
4035
COPY --from=swagger-ui /usr/share/nginx/html/swagger-ui.css swagger-ui-assets/swagger-ui.css
4136
COPY --from=swagger-ui /usr/share/nginx/html/swagger-ui-bundle.js swagger-ui-assets/swagger-ui-bundle.js
4237

43-
RUN poetry install
44-
RUN $POETRY_VENV/bin/pip install torch==2.6.0+cu126 torchaudio==2.6.0+cu126 --index-url https://download.pytorch.org/whl/cu126
38+
RUN poetry config virtualenvs.in-project true
39+
RUN poetry install --extras cuda
4540

4641
EXPOSE 9000
4742

48-
CMD whisper-asr-webservice
43+
ENTRYPOINT ["whisper-asr-webservice"]

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,14 @@ For complete documentation, visit:
7575
## Development
7676

7777
```shell
78-
# Install poetry
78+
# Install poetry v2.X
7979
pip3 install poetry
8080

81-
# Install dependencies
82-
poetry install
81+
# Install dependencies for cpu
82+
poetry install --extras cpu
83+
84+
# Install dependencies for cuda
85+
poetry install --extras cuda
8386

8487
# Run service
8588
poetry run whisper-asr-webservice --host 0.0.0.0 --port 9000

docs/build.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
## Development Environment
22

3-
Install poetry with following command:
3+
Install poetry v2.X with following command:
44

55
```shell
66
pip3 install poetry
77
```
88

99
### Installation
1010

11-
Install packages:
11+
Install dependencies for cpu
1212

1313
```shell
14-
poetry install
14+
poetry install --extras cpu
15+
```
16+
17+
Install dependencies for cuda
18+
19+
```shell
20+
poetry install --extras cuda
1521
```
1622

1723
!!! Note

0 commit comments

Comments
 (0)