Add makefile and ngrok

This commit is contained in:
Plague Fox 2023-04-10 18:43:01 +04:00
parent 5d379bf7bc
commit ed8c56d2b1
3 changed files with 69 additions and 1 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/.devcontainer
/docker-compose.override.yml
data/

36
Makefile Normal file
View file

@ -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

View file

@ -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