Docker
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1WORKDIR /app
COPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txt
COPY . .RUN useradd --create-home bot && mkdir -p /app/.dyui && chown -R bot /app/.dyuiUSER bot
EXPOSE 8000CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--proxy-headers"]dyui[openai].dyui/.venv/__pycache__/.envBuild and run it with a volume for conversations and uploads:
docker build -t my-bot .docker run -p 8000:8000 \ -e OPENAI_API_KEY \ -e DYUI_SECRET \ -v my-bot-data:/app/.dyui \ my-bot-e OPENAI_API_KEY passes the variable from your shell into the container. To use your .env file instead, run docker run --env-file .env ...; Docker keeps quotes as part of the value, so leave values unquoted there. See API keys & environment for each provider’s variable.
Compose
Section titled “Compose”services: bot: build: . ports: ["8000:8000"] environment: OPENAI_API_KEY: ${OPENAI_API_KEY} DYUI_SECRET: ${DYUI_SECRET} volumes: - bot-data:/app/.dyui restart: unless-stoppedvolumes: bot-data:Keep a single container per app, or use sticky sessions; see Run one process per app.