From 8f77bb89f2f56230b4626f780c67649031200dd0 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Thu, 5 Jan 2023 15:03:53 -0600 Subject: [PATCH] feat(image): add preliminary container files --- api/Containerfile.alpine | 12 ++++++++++++ api/Containerfile.buster | 12 ++++++++++++ gui/Containerfile.alpine | 20 ++++++++++++++++++++ gui/Containerfile.buster | 20 ++++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 api/Containerfile.alpine create mode 100644 api/Containerfile.buster create mode 100644 gui/Containerfile.alpine create mode 100644 gui/Containerfile.buster diff --git a/api/Containerfile.alpine b/api/Containerfile.alpine new file mode 100644 index 00000000..0ec7d42b --- /dev/null +++ b/api/Containerfile.alpine @@ -0,0 +1,12 @@ +FROM docker.io/python:3.10-alpine + +WORKDIR /onnx-web + +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/rocm5.2 + +ENTRYPOINT [ "flask", "--app=serve", "run", "--host=0.0.0.0" ] diff --git a/api/Containerfile.buster b/api/Containerfile.buster new file mode 100644 index 00000000..a606ff5e --- /dev/null +++ b/api/Containerfile.buster @@ -0,0 +1,12 @@ +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 + +RUN pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/rocm5.2 + +ENTRYPOINT [ "flask", "--app=serve", "run", "--host=0.0.0.0" ] diff --git a/gui/Containerfile.alpine b/gui/Containerfile.alpine new file mode 100644 index 00000000..a27b96fa --- /dev/null +++ b/gui/Containerfile.alpine @@ -0,0 +1,20 @@ +FROM docker.artifacts.apextoaster.com/library/node:18-alpine + +ENV PATH="${PATH}:$(yarn global bin)" + +WORKDIR /onnx-web + +# copy package first, to invalidate other layers when version changes +COPY package.json /onnx-web/package.json +COPY yarn.lock /onnx-web/yarn.lock +RUN yarn install --production + +# copy chunks, largest to smallest (entrypoint) +COPY out/src/ /onnx-web/out/src/ +COPY out/bundle/ /onnx-web/out/bundle/ + +# set up as global cli tool +RUN yarn global add file:$(pwd) + +ENTRYPOINT [ "node", "/onnx-web/out/bundle/main.js" ] +CMD [ "--help" ] diff --git a/gui/Containerfile.buster b/gui/Containerfile.buster new file mode 100644 index 00000000..540effbf --- /dev/null +++ b/gui/Containerfile.buster @@ -0,0 +1,20 @@ +FROM docker.artifacts.apextoaster.com/library/node:18-buster + +ENV PATH="${PATH}:$(yarn global bin)" + +WORKDIR /onnx-web + +# copy package first, to invalidate other layers when version changes +COPY package.json /onnx-web/package.json +COPY yarn.lock /onnx-web/yarn.lock +RUN yarn install --production + +# copy chunks, largest to smallest (entrypoint) +COPY out/src/ /onnx-web/out/src/ +COPY out/bundle/ /onnx-web/out/bundle/ + +# set up as global cli tool +RUN yarn global add file:$(pwd) + +ENTRYPOINT [ "node", "/onnx-web/out/bundle/main.js" ] +CMD [ "--help" ]