2024-06-05 16:11:52 -04:00
|
|
|
ARG HARDENED_MALLOC_VERSION=2024060400
|
2024-05-30 14:40:27 -04:00
|
|
|
|
|
|
|
### Build Hardened Malloc
|
|
|
|
FROM alpine:latest as hmalloc-builder
|
|
|
|
|
|
|
|
ARG HARDENED_MALLOC_VERSION
|
|
|
|
ARG CONFIG_NATIVE=false
|
|
|
|
ARG VARIANT=default
|
|
|
|
|
|
|
|
RUN apk -U upgrade \
|
|
|
|
&& apk --no-cache add build-base git gnupg openssh-keygen
|
|
|
|
|
|
|
|
RUN cd /tmp \
|
|
|
|
&& git clone --depth 1 --branch ${HARDENED_MALLOC_VERSION} https://github.com/GrapheneOS/hardened_malloc \
|
|
|
|
&& cd hardened_malloc \
|
|
|
|
&& wget -q https://grapheneos.org/allowed_signers -O grapheneos_allowed_signers \
|
|
|
|
&& git config gpg.ssh.allowedSignersFile grapheneos_allowed_signers \
|
|
|
|
&& git verify-tag $(git describe --tags) \
|
|
|
|
&& make CONFIG_NATIVE=${CONFIG_NATIVE} VARIANT=${VARIANT}
|
|
|
|
|
|
|
|
### Build Production
|
|
|
|
|
2023-03-16 20:39:59 -04:00
|
|
|
FROM node:alpine
|
|
|
|
|
|
|
|
LABEL maintainer="Thien Tran contact@tommytran.io"
|
|
|
|
|
|
|
|
ARG UID=992
|
|
|
|
ARG GID=992
|
|
|
|
|
|
|
|
RUN apk -U upgrade \
|
2024-05-30 14:40:27 -04:00
|
|
|
&& apk --no-cache add git \
|
|
|
|
&& adduser -g ${GID} -u ${UID} --disabled-password --gecos "" matrix-to
|
2023-03-16 20:39:59 -04:00
|
|
|
|
|
|
|
USER matrix-to
|
2023-03-16 20:43:28 -04:00
|
|
|
|
|
|
|
WORKDIR /home/matrix-to
|
|
|
|
|
|
|
|
RUN git clone https://github.com/matrix-org/matrix.to
|
|
|
|
|
2023-03-16 21:56:26 -04:00
|
|
|
COPY element.patch /home/matrix-to/matrix.to
|
|
|
|
|
2023-03-16 20:43:28 -04:00
|
|
|
WORKDIR /home/matrix-to/matrix.to
|
|
|
|
|
2023-03-16 21:56:26 -04:00
|
|
|
RUN git apply /home/matrix-to/matrix.to/element.patch \
|
2024-05-30 14:40:27 -04:00
|
|
|
&& rm -rf .git \
|
|
|
|
&& yarn \
|
|
|
|
&& yarn build
|
|
|
|
|
|
|
|
COPY --from=hmalloc-builder /tmp/hardened_malloc/out/libhardened_malloc.so /usr/local/lib/
|
|
|
|
|
|
|
|
ENV LD_PRELOAD="/usr/local/lib/libhardened_malloc.so"
|
2023-03-16 20:43:28 -04:00
|
|
|
|
2023-03-16 20:39:59 -04:00
|
|
|
EXPOSE 5000
|
|
|
|
|
|
|
|
ENTRYPOINT ["yarn", "start"]
|