diff --git a/Dockerfile b/Dockerfile index dc2e048..c7fa6f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,13 +4,18 @@ ARG PY_VERSION=3.9 FROM python:${PY_VERSION} as base FROM base as builder ARG PY_VERSION +ARG TARGETPLATFORM + COPY . . RUN mkdir /install /src WORKDIR /install RUN pip install --target="/install" --upgrade pip setuptools wheel RUN pip install --target="/install" --upgrade setuptools_rust -RUN pip install --target="/install" --upgrade torch==1.9.0+cpu torchvision==0.10.0+cpu -f https://download.pytorch.org/whl/torch_stable.html +# if empty run as usual, if amd64 do the same, if arm64 load an arm version of torch +RUN if [ -z "{$TARGETPLATFORM}" ]; then pip install --target="/install" --upgrade torch==1.9.1+cpu torchvision==0.10.1+cpu -f https://download.pytorch.org/whl/torch_stable.html ; fi +RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then pip install --target="/install" --upgrade torch==1.9.1+cpu torchvision==0.10.1+cpu -f https://download.pytorch.org/whl/torch_stable.html ; fi +RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then pip install --target="/install" --upgrade torch==1.9.0 torchvision==0.10.0 -f https://torch.kmtea.eu/whl/stable.html -f https://ext.kmtea.eu/whl/stable.html ; fi RUN pip install --target="/install" --upgrade git+https://github.com/openai/whisper.git COPY requirements.txt /install RUN pip install --target="/install" -r requirements.txt