# 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 . # Install dependencies from requirements RUN pip install --no-cache-dir -r src/requirements.txt # Runtime directory where user-editable files will live ENV PYTHONPATH=/app/src WORKDIR /app # On first run, populate /app from the fallback template folder CMD ["sh", "-c", "\ mkdir -p /app && \ [ -f /app/settings.yml ] || cp -r /opt/template/* /app && \ cd /app && \ python src/bot.py"]