1
0
Fork 0
onnx-web/api/Containerfile.cpu.buster

32 lines
758 B
Plaintext

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
ENV PATH="/onnx-web/api/onnx_web/bin:$PATH"
RUN pip3 install pip --upgrade
RUN pip3 install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu --no-cache-dir --ignore-installed
COPY requirements.txt /onnx-web/api/requirements.txt
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/
CMD [ "flask", "--app=onnx_web.serve", "run", "--host=0.0.0.0" ]