From 5e9890fb822bcf573e4f9c5b63095d091a9637ad Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Fri, 6 Jan 2023 15:04:07 -0600 Subject: [PATCH] feat(build): add nginx-based GUI images --- .gitlab-ci.yml | 26 ++++++++++++++----- README.md | 10 +++---- gui/Containerfile.nginx.alpine | 5 ++++ gui/Containerfile.nginx.bullseye | 5 ++++ ...rfile.alpine => Containerfile.node.alpine} | 0 ...rfile.buster => Containerfile.node.buster} | 0 6 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 gui/Containerfile.nginx.alpine create mode 100644 gui/Containerfile.nginx.bullseye rename gui/{Containerfile.alpine => Containerfile.node.alpine} (100%) rename gui/{Containerfile.buster => Containerfile.node.buster} (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 95907aba..6ec77a45 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -111,19 +111,33 @@ package-api-oci-buster: IMAGE_ARCH: buster IMAGE_FILE: Containerfile.buster -package-gui-oci-alpine: +package-gui-oci-nginx-alpine: extends: - .package-gui-oci variables: - IMAGE_ARCH: alpine - IMAGE_FILE: Containerfile.alpine + IMAGE_ARCH: nginx-alpine + IMAGE_FILE: Containerfile.nginx.alpine -package-gui-oci-buster: +package-gui-oci-nginx-bullseye: extends: - .package-gui-oci variables: - IMAGE_ARCH: buster - IMAGE_FILE: Containerfile.buster + IMAGE_ARCH: nginx-buster + IMAGE_FILE: Containerfile.nginx.buster + +package-gui-oci-node-alpine: + extends: + - .package-gui-oci + variables: + IMAGE_ARCH: node-alpine + IMAGE_FILE: Containerfile.node.alpine + +package-gui-oci-node-bullseye: + extends: + - .package-gui-oci + variables: + IMAGE_ARCH: node-buster + IMAGE_FILE: Containerfile.node.buster package-api-twine: extends: diff --git a/README.md b/README.md index 183fec40..41c27f5e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ for more than a week, I would like to add img2img and Nvidia support. ![txt2img with example astronaut prompt and image](./docs/readme-preview.png) -Based on work by: +Based on guides by: - https://gist.github.com/harishanand95/75f4515e6187a6aa3261af6ac6f61269 - https://gist.github.com/averad/256c507baa3dcc9464203dc14610d674 @@ -38,8 +38,8 @@ Based on work by: - [Install Git and Python](#install-git-and-python) - [Create a virtual environment](#create-a-virtual-environment) - [Install pip packages](#install-pip-packages) - - [Install ORT Nightly package](#install-ort-nightly-package) - - [Download and Convert Models](#download-and-convert-models) + - [Install ORT nightly package](#install-ort-nightly-package) + - [Download and convert models](#download-and-convert-models) - [Usage](#usage) - [Configuring and running the server](#configuring-and-running-the-server) - [Securing the server](#securing-the-server) @@ -156,7 +156,7 @@ has more details. I got a warning about an incompatibility in `protobuf` when installing the `onnxruntime-directml` package, but have not seen any issues. Some of the gist guides recommend `diffusers=0.3.0`, but I had trouble with old versions of `diffusers` before 0.6.0 or so. If I can determine a good set of working versions, I will pin them in `requirements.txt`. -### Install ORT Nightly package +### Install ORT nightly package Download the latest DirectML ORT nightly package for your version of Python and install it with pip. @@ -170,7 +170,7 @@ Python 3.10, download the `cp310` package. For Python 3.9, download the `cp39` p Make sure to include the `--force-reinstall` flag, since it requires some older versions of other packages, and will overwrite the versions you currently have installed. -### Download and Convert Models +### Download and convert models Sign up for an account at https://huggingface.co and find the models you want to use. Popular options include: diff --git a/gui/Containerfile.nginx.alpine b/gui/Containerfile.nginx.alpine new file mode 100644 index 00000000..16dd056e --- /dev/null +++ b/gui/Containerfile.nginx.alpine @@ -0,0 +1,5 @@ +FROM docker.io/nginx:1.22-alpine + +COPY out/bundle/index.html /usr/share/nginx/html/index.html +COPY out/bundle/config.json /usr/share/nginx/html/configl.json +COPY out/bundle/main.js /usr/share/nginx/html/main.js \ No newline at end of file diff --git a/gui/Containerfile.nginx.bullseye b/gui/Containerfile.nginx.bullseye new file mode 100644 index 00000000..a03f3b98 --- /dev/null +++ b/gui/Containerfile.nginx.bullseye @@ -0,0 +1,5 @@ +FROM docker.io/nginx:1.22 + +COPY out/bundle/index.html /usr/share/nginx/html/index.html +COPY out/bundle/config.json /usr/share/nginx/html/configl.json +COPY out/bundle/main.js /usr/share/nginx/html/main.js \ No newline at end of file diff --git a/gui/Containerfile.alpine b/gui/Containerfile.node.alpine similarity index 100% rename from gui/Containerfile.alpine rename to gui/Containerfile.node.alpine diff --git a/gui/Containerfile.buster b/gui/Containerfile.node.buster similarity index 100% rename from gui/Containerfile.buster rename to gui/Containerfile.node.buster