# Use Python base image FROM python:3.11.9-slim # Safe internal fallback directory for the default source code WORKDIR /opt/template # Copy code and config into /opt/template COPY src/ ./src COPY src/settings.yml . COPY src/persona.json . COPY .env . COPY bot_launcher.py . COPY requirements-webui.txt . # Install dependencies from requirements RUN pip install --no-cache-dir -r src/requirements.txt && \ pip install --no-cache-dir -r requirements-webui.txt # Runtime directory where user-editable files will live ENV PYTHONPATH=/app/src WORKDIR /app # Expose web UI port EXPOSE 8080 # On first run, populate /app from the fallback template folder # Use bot_launcher.py to start both bot and web UI CMD ["sh", "-c", "\ mkdir -p /app && \ [ -f /app/settings.yml ] || cp -r /opt/template/* /app && \ cd /app && \ python bot_launcher.py"]