Created
January 29, 2025 16:24
-
-
Save kurai021/d0506bcfd1652383598d329bdfc79477 to your computer and use it in GitHub Desktop.
Open WebUI Dockerfile and Docker Compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
ollama: | |
image: ollama/ollama | |
container_name: ollama | |
ports: | |
- "11434:11434" | |
volumes: | |
- ./ollama:/root/.ollama | |
restart: unless-stopped | |
open-webui: | |
image: ghcr.io/open-webui/open-webui:main | |
container_name: open-webui | |
environment: | |
- OLLAMA_BASE_URL=http://ollama:11434 | |
ports: | |
- "8080:8080" | |
volumes: | |
- ./open-webui:/app/backend/data | |
restart: unless-stopped | |
stable-diffusion-webui: | |
image: stable-diffusion-webui | |
ports: | |
- "7860:7860" | |
volumes: | |
- ./stable-diffusion/models:/app/stable-diffusion-webui/models | |
- ./stable-diffusion/outputs:/app/stable-diffusion-webui/outputs | |
- ./stable-diffusion/extensions:/app/stable-diffusion-webui/extensions | |
- ./stable-diffusion/localizations:/app/stable-diffusion-webui/localizations | |
environment: | |
PYTHONUNBUFFERED: 1 | |
volumes: | |
ollama: | |
open-webui: | |
stable-diffusion-webui: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:22.04 | |
# Actualiza el sistema e instala dependencias | |
RUN apt-get update && apt-get install -y \ | |
wget git python3 python3-venv python3-pip libgl1 libglib2.0-0 libtcmalloc-minimal4 && \ | |
apt-get clean | |
# Crea un usuario no root y establece permisos | |
RUN useradd -m -s /bin/bash sduser | |
WORKDIR /app | |
RUN chown -R sduser:sduser /app | |
# Cambia al usuario no root | |
USER sduser | |
# Clona el repositorio de Stable Diffusion WebUI | |
RUN git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git /app/stable-diffusion-webui | |
# Instala dependencias de Python necesarias | |
WORKDIR /app/stable-diffusion-webui | |
RUN python3 -m venv venv && \ | |
./venv/bin/pip install --upgrade pip && \ | |
./venv/bin/pip install -r requirements.txt | |
# Establece el puerto de escucha | |
EXPOSE 7860 | |
# Establece las variables de entorno | |
ENV PYTORCH_TRACING_MODE=TORCHFX | |
ENV COMMANDLINE_ARGS="--skip-torch-cuda-test --precision full --opt-split-attention-v1 --medvram --no-half --listen --api" | |
# Ejecuta el servidor de Stable Diffusion WebUI | |
CMD ["bash", "webui.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment