mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-11-28 19:23:14 +01:00
Create docker-compose for ui and ai
This commit is contained in:
parent
891489e959
commit
0ccfa3dba9
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
FROM python:3.9
|
||||||
|
|
||||||
|
RUN mkdir /app
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apt update
|
||||||
|
|
||||||
|
COPY requirements.txt ./
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
EXPOSE 8000
|
||||||
|
|
||||||
|
ENTRYPOINT ["uvicorn", "main:app", "--reload", "--host", "0.0.0.0"]
|
28
docker-compose.yml
Normal file
28
docker-compose.yml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
version: '3.3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
stability-ai:
|
||||||
|
container_name: sd
|
||||||
|
ports:
|
||||||
|
- '5000:5000'
|
||||||
|
image: 'r8.im/stability-ai/stable-diffusion@sha256:06eb78b36068500c616a7f33c15e6fa40404f8e14b5bfad57ebe0c7fe0f6bdf1'
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
reservations:
|
||||||
|
devices:
|
||||||
|
- capabilities: [gpu]
|
||||||
|
|
||||||
|
stable-diffusion-ui:
|
||||||
|
container_name: sd-ui
|
||||||
|
ports:
|
||||||
|
- '8000:8000'
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
depends_on:
|
||||||
|
- stability-ai
|
||||||
|
|
||||||
|
networks:
|
||||||
|
default:
|
@ -92,6 +92,7 @@ function setStatus(statusType, msg, msgType) {
|
|||||||
|
|
||||||
function playSound() {
|
function playSound() {
|
||||||
const audio = new Audio('/ding.mp3')
|
const audio = new Audio('/ding.mp3')
|
||||||
|
audio.volume = 0.2
|
||||||
audio.play()
|
audio.play()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
main.py
2
main.py
@ -4,7 +4,7 @@ from pydantic import BaseModel
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
LOCAL_SERVER_URL = 'http://localhost:5000'
|
LOCAL_SERVER_URL = 'http://stability-ai:5000'
|
||||||
PREDICT_URL = LOCAL_SERVER_URL + '/predictions'
|
PREDICT_URL = LOCAL_SERVER_URL + '/predictions'
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
3
requirements.txt
Normal file
3
requirements.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
requests
|
||||||
|
fastapi==0.80.0
|
||||||
|
uvicorn==0.18.2
|
Loading…
Reference in New Issue
Block a user