From 5e7b0cf1189294ece92afbbe84d44f15ecc40ba0 Mon Sep 17 00:00:00 2001 From: Konie Date: Thu, 2 Nov 2023 17:31:29 +0800 Subject: [PATCH] Fixed docker start problem --- Dockerfile | 2 ++ README.md | 3 +++ fooocus_api_version.py | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 80db063..2f7aa92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,8 @@ ENV VIRTUAL_ENV=/opt/venv RUN virtualenv $VIRTUAL_ENV ENV PATH="$VIRTUAL_ENV/bin:$PATH" +RUN pip install packaging + WORKDIR /app COPY . /app/ diff --git a/README.md b/README.md index 3efd802..d5f68be 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,8 @@ python main.py -h ``` ### Start with docker +Before use docker with GPU, you should [install NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) first. + Run ``` docker run --gpus=all -e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all -p 8888:8888 konieshadow/fooocus-api @@ -60,6 +62,7 @@ docker run --gpus=all -e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VI ``` It will persistent the dependent repositories and pip cache. +You can add `-e PIP_INDEX_URL={pypi-mirror-url}` to docker run command to change pip index url. ### Test API You can open the Swagger Document in "http://127.0.0.1:8888/docs", then click "Try it out" to send a request. diff --git a/fooocus_api_version.py b/fooocus_api_version.py index c54332d..41522f1 100644 --- a/fooocus_api_version.py +++ b/fooocus_api_version.py @@ -1 +1 @@ -version = '0.3.5' \ No newline at end of file +version = '0.3.6' \ No newline at end of file