2025-05-10 00:26:28 -04:00
|
|
|
# Use Python base image
|
|
|
|
|
FROM python:3.11.9-slim
|
|
|
|
|
|
2025-06-08 13:08:57 -04:00
|
|
|
# Safe internal fallback directory for the default source code
|
|
|
|
|
WORKDIR /opt/template
|
2025-05-10 00:26:28 -04:00
|
|
|
|
2025-06-08 13:08:57 -04:00
|
|
|
# Copy code and config into /opt/template
|
2025-05-10 00:26:28 -04:00
|
|
|
COPY src/ ./src
|
2025-05-10 23:42:35 -04:00
|
|
|
COPY src/settings.yml .
|
2025-06-08 13:08:57 -04:00
|
|
|
COPY src/persona.json .
|
2025-05-10 00:26:28 -04:00
|
|
|
COPY .env .
|
|
|
|
|
|
2025-06-08 13:08:57 -04:00
|
|
|
# Install dependencies from requirements
|
|
|
|
|
RUN pip install --no-cache-dir -r src/requirements.txt
|
|
|
|
|
|
|
|
|
|
# Runtime directory where user-editable files will live
|
2025-05-10 00:26:28 -04:00
|
|
|
ENV PYTHONPATH=/app/src
|
2025-06-08 13:08:57 -04:00
|
|
|
WORKDIR /app
|
2025-05-10 00:26:28 -04:00
|
|
|
|
2025-06-08 13:08:57 -04:00
|
|
|
# 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"]
|