AI-Discord-Bot/Dockerfile

26 lines
649 B
Text
Raw Normal View History

# 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
2025-05-10 23:42:35 -04:00
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"]