diff --git a/dendrite/Dockerfile b/dendrite/Dockerfile new file mode 100644 index 0000000..88fb75a --- /dev/null +++ b/dendrite/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:buster as builder + +ARG DEBIAN_FRONTEND=noninteractive +COPY dendrite /dendrite +WORKDIR /dendrite +RUN ./build.sh + +FROM debian:buster + +COPY --from=builder /dendrite/bin/ /usr/local/bin/ +COPY --from=builder /dendrite/dendrite-config.yaml /usr/local/share/ +COPY entrypoint.sh /usr/local/bin/ + +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] diff --git a/dendrite/Makefile b/dendrite/Makefile new file mode 100644 index 0000000..11928bb --- /dev/null +++ b/dendrite/Makefile @@ -0,0 +1,21 @@ +NAMESPACE=alemairebe +include version + +IMAGE=dendrite + +nopush: git-clone + docker buildx build --platform linux/amd64 --load \ + --build-arg VERSION=$(VERSION) \ + --tag ${NAMESPACE}/${IMAGE}:$(VERSION) \ + --tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) . + +push: git-clone + docker buildx build --platform linux/amd64,linux/arm64,linux/arm,linux/ppc64le --push \ + --build-arg VERSION=$(VERSION) \ + --cache-from=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ + --cache-to=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \ + --tag ${NAMESPACE}/${IMAGE}:$(VERSION) \ + --tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) . + +git-clone: + git clone -b v${VERSION} --depth 1 https://github.com/matrix-org/dendrite.git diff --git a/dendrite/entrypoint.sh b/dendrite/entrypoint.sh new file mode 100755 index 0000000..527e302 --- /dev/null +++ b/dendrite/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +if [ ! -f /usr/local/etc/dendrite.yaml ]; then + cp /usr/local/share/dendrite-config.yaml /usr/local/etc/dendrite.yaml +fi + +if [ ! -f /usr/local/etc/matrix_key.pem ]; then + /usr/local/bin/generate-keys --private-key /usr/local/etc/matrix_key.pem +fi + +/usr/local/bin/dendrite-monolith-server --config /usr/local/etc/dendrite.yaml + + diff --git a/dendrite/version b/dendrite/version new file mode 100644 index 0000000..be71e31 --- /dev/null +++ b/dendrite/version @@ -0,0 +1 @@ +VERSION=0.3.5