1
0
Fork 0

fix(build): add cv2 deps to CPU image

This commit is contained in:
Sean Sube 2023-01-21 14:43:36 -06:00
parent 1ed7b221c4
commit 77d68bf6ac
5 changed files with 33 additions and 0 deletions

View File

@ -2,6 +2,10 @@ FROM docker.io/python:3.10-buster
WORKDIR /onnx-web/api
RUN apt-get -y update \
&& apt-get install -y ffmpeg libsm6 libxext6 \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install virtualenv --upgrade
RUN python3 -m venv onnx_env
@ -18,6 +22,8 @@ RUN pip3 install -r requirements.txt --no-cache-dir
COPY onnx_web/ /onnx-web/api/onnx_web/
COPY params.json /onnx-web/api/params.json
ENV ONNX_WEB_BUNDLE_PATH="/onnx-web/gui"
COPY gui/ /onnx-web/gui/

3
api/gui/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
bundle/main.js
config.json
index.html

View File

@ -0,0 +1,24 @@
services:
onnx-web-api:
image: docker.io/ssube/onnx-web-api:main-cpu-buster
command: sh -c "python -m onnx_web.convert --diffusion --upscaling --correction && flask --app=onnx_web.serve run --host=0.0.0.0"
environment:
- ONNX_WEB_MODEL_PATH=/data/models
- ONNX_WEB_OUTPUT_PATH=/data/outputs
ports:
- "5000:5000"
volumes:
- type: volume
source: onnx-web-models
target: /data/models
volume:
nocopy: true
- type: volume
source: onnx-web-outputs
target: /data/outputs
volume:
nocopy: true
volumes:
onnx-web-models: {}
onnx-web-outputs: {}