fix(build): add launcher script and use for API images
This commit is contained in:
parent
dddadfc9a2
commit
88f9b624ec
|
@ -22,10 +22,12 @@ RUN pip3 install -r requirements.txt --no-cache-dir
|
||||||
|
|
||||||
COPY onnx_web/ /onnx-web/api/onnx_web/
|
COPY onnx_web/ /onnx-web/api/onnx_web/
|
||||||
|
|
||||||
|
COPY launch.sh /onnx-web/launch.sh
|
||||||
|
|
||||||
COPY params.json /onnx-web/api/params.json
|
COPY params.json /onnx-web/api/params.json
|
||||||
|
|
||||||
ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"
|
ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"
|
||||||
|
|
||||||
COPY gui/ /onnx-web/gui/
|
COPY gui/ /onnx-web/gui/
|
||||||
|
|
||||||
CMD [ "sh", "-c", "python -m onnx_web.convert --diffusion --upscaling --correction --extras && flask --app=onnx_web.serve run --host=0.0.0.0" ]
|
CMD [ "sh", "-c", "/onnx-web/launch.sh" ]
|
||||||
|
|
|
@ -26,10 +26,12 @@ RUN pip3 install onnxruntime-gpu --no-cache-dir
|
||||||
|
|
||||||
COPY onnx_web/ /onnx-web/api/onnx_web/
|
COPY onnx_web/ /onnx-web/api/onnx_web/
|
||||||
|
|
||||||
|
COPY launch.sh /onnx-web/launch.sh
|
||||||
|
|
||||||
COPY params.json /onnx-web/api/params.json
|
COPY params.json /onnx-web/api/params.json
|
||||||
|
|
||||||
ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"
|
ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"
|
||||||
|
|
||||||
COPY gui/ /onnx-web/gui/
|
COPY gui/ /onnx-web/gui/
|
||||||
|
|
||||||
CMD [ "sh", "-c", "python -m onnx_web.convert --diffusion --upscaling --correction --extras && flask --app=onnx_web.serve run --host=0.0.0.0" ]
|
CMD [ "sh", "-c", "/onnx-web/launch.sh" ]
|
||||||
|
|
|
@ -22,10 +22,12 @@ RUN pip3 install -r requirements.txt --no-cache-dir
|
||||||
|
|
||||||
COPY onnx_web/ /onnx-web/api/onnx_web/
|
COPY onnx_web/ /onnx-web/api/onnx_web/
|
||||||
|
|
||||||
|
COPY launch.sh /onnx-web/launch.sh
|
||||||
|
|
||||||
COPY params.json /onnx-web/api/params.json
|
COPY params.json /onnx-web/api/params.json
|
||||||
|
|
||||||
ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"
|
ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"
|
||||||
|
|
||||||
COPY gui/ /onnx-web/gui/
|
COPY gui/ /onnx-web/gui/
|
||||||
|
|
||||||
CMD [ "sh", "-c", "python -m onnx_web.convert --diffusion --upscaling --correction --extras && flask --app=onnx_web.serve run --host=0.0.0.0" ]
|
CMD [ "sh", "-c", "/onnx-web/launch.sh" ]
|
||||||
|
|
|
@ -20,10 +20,12 @@ RUN pip3 install -r requirements.txt --no-cache-dir
|
||||||
|
|
||||||
COPY onnx_web/ /onnx-web/api/onnx_web/
|
COPY onnx_web/ /onnx-web/api/onnx_web/
|
||||||
|
|
||||||
|
COPY launch.sh /onnx-web/launch.sh
|
||||||
|
|
||||||
COPY params.json /onnx-web/api/params.json
|
COPY params.json /onnx-web/api/params.json
|
||||||
|
|
||||||
ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"
|
ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"
|
||||||
|
|
||||||
COPY gui/ /onnx-web/gui/
|
COPY gui/ /onnx-web/gui/
|
||||||
|
|
||||||
CMD [ "sh", "-c", "python -m onnx_web.convert --diffusion --upscaling --correction --extras && flask --app=onnx_web.serve run --host=0.0.0.0" ]
|
CMD [ "sh", "-c", "/onnx-web/launch.sh" ]
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
echo "Downloading and converting models to ONNX format..."
|
||||||
|
python3 -m onnx_web.convert --diffusion --upscaling --correction --extras --token=${HF_TOKEN:-}
|
||||||
|
|
||||||
|
echo "Launching API server..."
|
||||||
|
flask --app=onnx_web.serve run --host=0.0.0.0
|
Loading…
Reference in New Issue