FROM python:3.8.12-slim-bullseye

WORKDIR /tmp/install
RUN apt -y update && apt -y install libolm-dev build-essential libolm3
RUN apt -y install wget curl pkg-config
RUN apt -y install libdbus-glib-1-dev libgirepository1.0-dev
RUN pip3 install --user --upgrade matrix-nio[e2e] markdown
RUN wget -O - https://raw.githubusercontent.com/8go/matrix-commander/master/requirements.txt | grep -v dbus | grep -v notify > ./requirements.txt
RUN pip3 install -r ./requirements.txt
WORKDIR /bin
RUN wget -O - https://raw.githubusercontent.com/8go/matrix-commander/master/matrix-commander.py | grep -v import.*magic | grep -v import.*dbus | grep -v import.*notify > ./matrix-commander.py && chmod +x ./matrix-commander.py
WORKDIR /cwd

#CMD ["/bin/matrix-commander.py"]
ENTRYPOINT ["/bin/matrix-commander.py"]
