diff --git a/api/Containerfile.alpine b/api/Containerfile.alpine index fede3b36..e7dba86c 100644 --- a/api/Containerfile.alpine +++ b/api/Containerfile.alpine @@ -5,11 +5,12 @@ RUN apk add --update cmake \ WORKDIR /onnx-web +RUN pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu + COPY requirements.txt /onnx-web/requirements.txt -COPY serve.py /onnx-web/serve.py RUN pip install -r requirements.txt -RUN pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu +COPY serve.py /onnx-web/serve.py ENTRYPOINT [ "flask", "--app=serve", "run", "--host=0.0.0.0" ] diff --git a/api/Containerfile.buster b/api/Containerfile.buster index ce9a189d..a3dc80d9 100644 --- a/api/Containerfile.buster +++ b/api/Containerfile.buster @@ -2,11 +2,14 @@ FROM docker.io/python:3.10-buster WORKDIR /onnx-web -COPY requirements.txt /onnx-web/requirements.txt -COPY serve.py /onnx-web/serve.py - -RUN pip install -r requirements.txt +# TODO: set up venv within the container RUN pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu +COPY requirements.txt /onnx-web/requirements.txt + +RUN pip install -r requirements.txt + +COPY serve.py /onnx-web/serve.py + ENTRYPOINT [ "flask", "--app=serve", "run", "--host=0.0.0.0" ]