-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
aab8552
commit c0c9410
Showing
3 changed files
with
52 additions
and
4 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
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#compatability with Tensorflow 2.6.0 as per https://www.tensorflow.org/install/source#gpu | ||
ARG PYTHON_VERSION=3.11 | ||
ARG UBUNTU_VERSION=focal | ||
ARG POETRY_VERSION=1.6.1 | ||
|
||
FROM python:$PYTHON_VERSION-slim as builder | ||
ARG POETRY_VERSION | ||
|
||
ENV POETRY_HOME=/opt/poetry | ||
ENV POETRY_VENV=/opt/poetry-venv | ||
ENV POETRY_CACHE_DIR=/opt/.cache | ||
|
||
# Install poetry separated from system interpreter | ||
RUN python3 -m venv $POETRY_VENV \ | ||
&& $POETRY_VENV/bin/pip install -U pip setuptools \ | ||
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION} | ||
|
||
# Add `poetry` to PATH | ||
ENV PATH="${PATH}:${POETRY_VENV}/bin" | ||
|
||
WORKDIR /src | ||
COPY poetry.lock pyproject.toml /src | ||
RUN poetry export --with=gpu --without-hashes -f requirements.txt > requirements.txt | ||
|
||
|
||
FROM python:$PYTHON_VERSION | ||
WORKDIR /root | ||
|
||
COPY --from=builder /src/requirements.txt . | ||
RUN --mount=type=cache,target=/root/.cache \ | ||
pip install --no-cache-dir -r requirements.txt && rm requirements.txt | ||
|
||
COPY . . | ||
RUN pip install --no-deps . && rm -r /root/* | ||
|
||
CMD ["bash"] |