add dendrite

This commit is contained in:
Adrien le Maire 2021-01-17 15:26:31 +01:00
parent bdd09a39bb
commit f561591cc7
4 changed files with 49 additions and 0 deletions

14
dendrite/Dockerfile Normal file
View File

@ -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"]

21
dendrite/Makefile Normal file
View File

@ -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

13
dendrite/entrypoint.sh Executable file
View File

@ -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

1
dendrite/version Normal file
View File

@ -0,0 +1 @@
VERSION=0.3.5