FROM cloudron/base:5.0.0@sha256:04fd70dbd8ad6149c19de39e35718e024417c3e01dc9c6637eaf4a41ec4e596c # Install Rust for building libsignal RUN apt-get update && apt-get install -y \ curl \ ca-certificates \ netcat-openbsd \ bash \ jq \ yq \ git \ build-essential \ libolm-dev \ gosu \ cmake \ protobuf-compiler \ clang \ libclang-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Install Rust RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:$PATH" # Install Go ENV GO_VERSION=1.24.0 RUN curl -LO https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz \ && tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz \ && rm go${GO_VERSION}.linux-amd64.tar.gz ENV PATH="/usr/local/go/bin:$PATH" # Create app directories RUN mkdir -p /app/code /app/pkg /app/data WORKDIR /app/code # Download and build mautrix-signal RUN git clone --branch v0.2512.0 https://github.com/mautrix/signal.git . \ && ./build-rust.sh \ && LIBRARY_PATH=/app/code/pkg/libsignalgo/libsignal/target/release ./build-go.sh \ && mv mautrix-signal /app/pkg/mautrix-signal # Copy startup script COPY start.sh /app/pkg/ # Set volumes and environment VOLUME /app/data ENV UID=1337 GID=1337 # Add health check endpoint - check if the appservice port is responding HEALTHCHECK --interval=60s --timeout=10s --start-period=30s --retries=3 \ CMD nc -z localhost 29328 || exit 1 CMD ["/app/pkg/start.sh"]