-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,37 @@ | ||
FROM nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu22.04 | ||
FROM docker.io/python:3.10@sha256:c6b64ba9c0f03c41e10f1e6053ca2ecf2dbced44098f8d56ed579aa50e839889 AS req | ||
|
||
# Create dirs for: | ||
# - Injecting config.yml: /root/.DANE | ||
# - Mount point for input & output files: /mnt/dane-fs | ||
# - Storing the source code: /src | ||
# - Storing the model: /model | ||
RUN mkdir /root/.DANE /mnt/dane-fs /src /data /model | ||
RUN python3 -m pip install pipx && \ | ||
python3 -m pipx ensurepath | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y python3-pip python3-dev python-is-python3 && \ | ||
rm -rf /var/lib/apt/lists/* | ||
RUN pipx install poetry==1.7.1 && \ | ||
pipx inject poetry poetry-plugin-export && \ | ||
pipx run poetry config warnings.export false | ||
|
||
WORKDIR /src | ||
COPY ./poetry.lock ./poetry.lock | ||
COPY ./pyproject.toml ./pyproject.toml | ||
RUN pipx run poetry export --format requirements.txt --output requirements.txt | ||
|
||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=1 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
FROM docker.io/python:3.10@sha256:c6b64ba9c0f03c41e10f1e6053ca2ecf2dbced44098f8d56ed579aa50e839889 | ||
|
||
RUN pip install poetry==1.8.2 | ||
# Create dirs for: | ||
# - Injecting config.yml: /root/.DANE | ||
# - Mount point for input & output files: /data | ||
# - Storing the source code: /src | ||
RUN mkdir \ | ||
/data \ | ||
/mnt/dane-fs \ | ||
/model \ | ||
/root/.DANE \ | ||
/src | ||
|
||
COPY pyproject.toml poetry.lock ./ | ||
WORKDIR /src | ||
|
||
RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR | ||
COPY --from=req ./requirements.txt requirements.txt | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# copy the rest into the source dir | ||
COPY ./ /src | ||
|
||
# Write provenance info about software versions to file | ||
RUN echo "dane-whisper-asr-worker;https://github.com/beeldengeluid/dane-whisper-asr-worker/commit/$(git rev-parse HEAD)" >> /software_provenance.txt | ||
|
||
ENTRYPOINT ["./docker-entrypoint.sh"] | ||
ENTRYPOINT ["./docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters