# AI Chat - Open WebUI for aichat.zoneco.org This folder contains the configuration for deploying [Open WebUI](https://github.com/open-webui/open-webui) at `aichat.zoneco.org`. ## Quick Start ### 1. Configure Environment ```bash cp .env.example .env ``` Edit `.env` and set your OpenAI API key: ``` OPENAI_API_KEY=sk-your-actual-api-key-here ``` ### 2. Deployment Options #### Option A: Deploy with the main infrastructure (recommended) The aichat service is already included in `funzone-infrastructure/docker-compose.yml`. Simply deploy from the infrastructure folder: ```bash cd ../funzone-infrastructure docker-compose up -d --build ``` #### Option B: Deploy standalone ```bash docker-compose -f docker-compose.aichat.yml up -d ``` This requires the `funzone-net` Docker network to exist. If it doesn't, create it: ```bash docker network create funzone-net ``` ## How It Works - The container `funzone_aichat` runs Open WebUI on port 8080 (mapped to `127.0.0.1:3005`) - Nginx proxies `https://aichat.zoneco.org` → `http://funzone_aichat:8080` - WebSocket connections are supported for streaming AI responses - Data is persisted in the `open-webui-data` Docker volume ## Environment Variables | Variable | Required | Description | |----------|----------|-------------| | `OPENAI_API_KEY` | Yes | Your OpenAI API key | | `WEBUI_NAME` | No | Display name for the UI | | `WEBUI_URL` | No | Public URL of the instance | | `WEBUI_SECRET_KEY` | No | Secret key for authentication | | `DEFAULT_USER_ROLE` | No | Default role for new users | | `ENABLE_SIGNUP` | No | Allow user registration | | `ENABLE_LOGIN` | No | Allow user login | | `DEFAULT_MODELS` | No | Default models to use | ## Files | File | Description | |------|-------------| | `.env.example` | Example environment variables | | `.env` | Your actual environment variables (gitignored) | | `docker-compose.aichat.yml` | Standalone docker-compose for aichat | | `README.md` | This file | ## Infrastructure Files Modified | File | Change | |------|--------| | `funzone-infrastructure/nginx/sites-available/aichat.zoneco.org.conf` | Nginx server block for aichat subdomain | | `funzone-infrastructure/nginx/nginx.conf` | Added upstream `aichat-service` pointing to `funzone_aichat:8080` | | `funzone-infrastructure/nginx/Dockerfile` | Added symlink for aichat config | | `funzone-infrastructure/docker-compose.yml` | Added aichat service and `open-webui-data` volume |