nest-matrix-bot/Dockerfile

30 lines
676 B
Text
Raw Normal View History

2026-07-22 13:33:47 -04:00
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
# Install libolm C library, CMake, C++ compiler, and Python headers for E2E crypto bindings
2026-07-22 16:44:42 -04:00
RUN apt-get update && apt-get install -y --no-install-recommends \
libolm-dev \
gcc \
g++ \
cmake \
2026-07-22 16:44:42 -04:00
python3-dev \
&& rm -rf /var/lib/apt/lists/*
2026-07-22 13:33:47 -04:00
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY matrix_keycloak_bot.py .
2026-07-22 16:44:42 -04:00
# Create the store directory for Olm/Megolm key databases
2026-07-22 13:33:47 -04:00
RUN useradd -m -u 10001 botuser && \
2026-07-22 16:44:42 -04:00
mkdir -p /app/store && \
2026-07-22 13:33:47 -04:00
chown -R botuser:botuser /app
USER botuser
CMD ["python", "matrix_keycloak_bot.py"]