diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9898e9d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.7-slim-stretch + +# Many of these dependencies are required to build the app's dependencies, so staging these out doesn't help much +RUN mkdir -p /app +RUN apt-get update && apt-get install -y git gcc clang cmake pkg-config libdbus-1-dev libglib2.0-dev libcairo2-dev python3-dev libgirepository1.0-dev wget + +WORKDIR /app +RUN wget https://gitlab.matrix.org/matrix-org/olm/-/archive/master/olm-master.tar.bz2 \ + && tar -xvf olm-master.tar.bz2 \ + && cd olm-master && make && make PREFIX="/usr" install && cd ../ \ + && rm -r olm-master + +COPY . /app +RUN pip install . gobject PyGObject "matrix-nio@git+https://github.com/poljar/matrix-nio.git@dev#egg=matrix-nio-0" && python setup.py install + +VOLUME /data +ENTRYPOINT ["pantalaimon"] +CMD ["-c", "/data/pantalaimon.conf"] diff --git a/README.md b/README.md index 884e907..4d99b05 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,30 @@ cd notification-daemon-mac-py ./notify.py ``` +### Docker + +An experimental Docker image can be built for Pantalaimon, primarily for use in bots. + +```bash +docker build -t pantalaimon . +# Create a pantalaimon.conf before running. The directory mentioned in the +# volume below is for where Pantalaimon should dump some data. +docker run -it --rm -v /path/to/pantalaimon/dir:/data -p 8008:8008 pantalaimon +``` + +An example `pantalaimon.conf` for Docker is: +```conf +[Default] +LogLevel = Debug +SSL = True + +[local-matrix] +Homeserver = https://matrix.org +ListenAddress = 0.0.0.0 +ListenPort = 8008 +SSL = False +``` + ### Experimental E2E search support. Pantalaimon can handle the search endpoint of a Matrix server as well, providing