Add image server

This commit is contained in:
2022-12-13 19:11:59 +13:00
parent 8ceb9fd08a
commit 40b657d45c
4 changed files with 95 additions and 0 deletions

15
imageserver/Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM nvidia/cuda:11.6.0-base-ubuntu20.04
RUN apt-get update && apt-get install python3 python3-pip -y
RUN pip3 install --upgrade diffusers transformers scipy python-dotenv cuda-python fastapi uvicorn httplib2 && \
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117 && \
pip3 install torch==1.11.0+cu115 torchvision==0.12.0+cu115 torchaudio==0.11.0+cu115 -f https://download.pytorch.org/whl/torch_stable.html && \
pip3 install python-multipart accelerate
WORKDIR /app
COPY main.py /app/main.py
VOLUME /root/.cache/huggingface/diffusers/
CMD [ "uvicorn", "main:app", "--host", "0.0.0.0", "--reload" ]