diff --git a/.gitignore b/.gitignore index f64b472..cc26ad9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /.devcontainer /docker-compose.override.yml +data/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d2e41e5 --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +.PHONY: build start run stop restart refresh + +# Build the docker container +# +# docker compose --profile download up --build +build: + @docker compose --profile download up --build + @docker compose --profile auto up --build + +# Start the docker container +# +# docker compose --profile [ui] up --build +# Where [ui] is one of: invoke | auto | auto-cpu | sygil | sygil-sl +# + invoke: One of the earliest forks, stunning UI Repo by InvokeAI +# + auto: The most popular fork, many features with neat UI, Repo by AUTOMATIC1111 +# + auto-cpu: for users without a GPU. +# + sygil: Another great fork Repo by Sygil-Dev +# + sygil-sl: A second version of the above using streamlit (still in development, has bugs) +# +# docker compose --profile auto up -d +# Web UI: http://localhost:7860/ +start: + @docker compose --profile auto up + +# Stop the docker container +stop: + @docker compose --profile auto down + +run: start + +refresh: start + +restart: stop start + +shell: + @docker exec -it $(shell docker ps -qf "name=auto") /bin/bash \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index e005e77..7648660 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,21 +19,29 @@ name: webui-docker services: download: + container_name: download + restart: on-failure build: ./services/download/ profiles: ["download"] + mem_limit: 16g volumes: - *v1 auto: &automatic <<: *base_service + container_name: auto + restart: on-failure profiles: ["auto"] + mem_limit: 16g build: ./services/AUTOMATIC1111 image: sd-auto:51 environment: - - CLI_ARGS=--allow-code --medvram --xformers --enable-insecure-extension-access --api + - CLI_ARGS=--allow-code --medvram --xformers --enable-insecure-extension-access --api --listen auto-cpu: <<: *automatic + container_name: auto-cpu + restart: on-failure profiles: ["auto-cpu"] deploy: {} environment: @@ -41,6 +49,8 @@ services: invoke: <<: *base_service + container_name: invoke + restart: on-failure profiles: ["invoke"] build: ./services/invoke/ image: sd-invoke:26 @@ -51,6 +61,8 @@ services: sygil: &sygil <<: *base_service + container_name: sygil + restart: on-failure profiles: ["sygil"] build: ./services/sygil/ image: sd-sygil:16 @@ -60,6 +72,25 @@ services: sygil-sl: <<: *sygil + container_name: sygil-sl + restart: on-failure profiles: ["sygil-sl"] environment: - USE_STREAMLIT=1 + + # Web access to the docker containers + # https://ngrok.com/docs/using-ngrok-with/docker/ + # http://127.0.0.1:4040/inspect/http + ngrok: + image: ngrok/ngrok:latest + container_name: ngrok + restart: unless-stopped + command: + - "start" + - "--all" + - "--config" + - "/etc/ngrok.yml" + volumes: + - ./data/ngrok/ngrok.yml:/etc/ngrok.yml + ports: + - 4040:4040 \ No newline at end of file