Files
miku-discord/bot/Dockerfile

71 lines
2.0 KiB
Docker
Raw Normal View History

2025-12-07 17:15:09 +02:00
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt && pip cache purge
2025-12-07 17:15:09 +02:00
2026-01-09 00:03:59 +02:00
# Install system dependencies
# ffmpeg: video/audio processing for media handling
# libgl1: OpenGL library required by opencv-contrib-python
# libglib2.0-0: GLib library (common dependency)
2025-12-07 17:15:09 +02:00
RUN apt-get update && apt-get install -y \
ffmpeg \
2026-01-09 00:03:59 +02:00
libgl1 \
libglib2.0-0 \
ca-certificates \
curl \
gnupg \
lsb-release \
2025-12-07 17:15:09 +02:00
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /usr/share/doc
2025-12-07 17:15:09 +02:00
# Install Playwright browsers with system dependencies (for UNO automation)
RUN playwright install --with-deps chromium
# Remove unused system packages to reduce image size
# Note: Playwright installs many dependencies; we remove what we can safely
RUN apt-get remove -y \
pocketsphinx-en-us \
pocketsphinx \
libflite1 \
libpocketsphinx3 \
mesa-vulkan-drivers \
mesa-va-drivers \
mesa-vdpau-drivers \
libvulkan1 \
|| true && \
apt-get autoremove -y && \
apt-get install -y libgl1 libglib2.0-0 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install Docker CLI and docker compose plugin so the bot can build/create the face detector container
RUN set -eux; \
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg; \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
> /etc/apt/sources.list.d/docker.list; \
apt-get update; \
apt-get install -y docker-ce-cli docker-compose-plugin; \
apt-get clean; rm -rf /var/lib/apt/lists/*
2025-12-07 17:15:09 +02:00
COPY bot.py .
COPY server_manager.py .
COPY command_router.py .
COPY config.py .
COPY config_manager.py .
2025-12-07 17:15:09 +02:00
COPY utils /app/utils
COPY commands /app/commands
COPY memory /app/memory
COPY static /app/static
COPY globals.py .
COPY api.py .
COPY api_main.py .
refactor: deduplicate prompts, reorganize persona files, update paths Prompt deduplication (~20% reduction, 4,743 chars saved): - evil_miku_lore.txt: remove intra-file duplication (height rule 2x, cruelty-has-substance 2x, music secret 2x, adoration secret 2x), trim verbose restatements, cut speech examples from 10 to 6 - evil_miku_prompt.txt: remove entire PERSONALITY section (in lore), remove entire RESPONSE STYLE section (now only in preamble), soften height from prohibition to knowledge - miku_lore.txt: remove RELATIONSHIPS section (duplicates FRIENDS) - miku_prompt.txt: remove duplicate intro, 4 personality traits already in lore, FAMOUS SONGS section (in lore), fix response length inconsistency (1-2 vs 2-3 -> consistent 2-3) Preamble updates (evil_mode.py, evil_miku_personality.py, llm.py, miku_personality.py): - Response rules now exist in ONE place only (preamble) - Height rule softened: model knows 15.8m, can say it if asked, but won't default to quoting it when taunting - Response length: 2-4 sentences (was 1-3), removed action template list that model was copying literally (*scoffs*, *rolls eyes*) - Added: always include actual words, never action-only responses - Normal Miku: trim CHARACTER CONTEXT, fix 1-3 -> 2-3 sentences Directory reorganization: - Move 6 persona files to bot/persona/{evil,miku}/ subdirectories - Update all open() paths in evil_mode.py, context_manager.py, voice_manager.py, both Cat plugins - Dockerfile: 6 COPY lines -> 1 (COPY persona /app/persona) - docker-compose: 6 file mounts -> 2 directory mounts (bot/persona/evil -> cat/data/evil, bot/persona/miku -> cat/data/miku) Evil Miku system (previously unstaged): - Full evil mood management: 2h rotation timer, mood persistence, 10 mood-specific autonomous template pools, mood-aware DMs - Evil mode toggle with role color/nickname/pfp management - get_evil_system_prompt() with mood integration Add test_evil_moods.py: 10-mood x 3-message comprehensive test
2026-02-27 13:14:03 +02:00
COPY persona /app/persona
2025-12-07 17:15:09 +02:00
COPY MikuMikuBeam.mp4 .
COPY Miku_BasicWorkflow.json .
COPY moods /app/moods/
CMD ["python", "-u", "bot.py"]