From 47847c423b9a5a6319651e7d9787511e75b58609 Mon Sep 17 00:00:00 2001 From: Samuel Philipp Date: Sat, 24 Sep 2022 23:37:24 +0000 Subject: [PATCH] Update 'Dockerfile' --- Dockerfile | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6025d4f..19d2313 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,21 @@ -FROM rust:1.62.1 as builder +FROM rust:alpine AS builder -RUN git clone https://github.com/matrix-org/rust-synapse-compress-state.git && \ - cargo install --path rust-synapse-compress-state +RUN apk add python3 musl-dev pkgconfig openssl-dev make -FROM debian:buster-slim +ENV RUSTFLAGS="-C target-feature=-crt-static" -RUN apt update && \ - apt install -y postgresql-client +WORKDIR /opt/synapse-compressor/ -COPY --from=builder /usr/local/cargo/bin/synapse-compress-state /usr/local/bin/synapse-compress-state +RUN git clone https://github.com/matrix-org/rust-synapse-compress-state.git . && \ + cargo build + +WORKDIR /opt/synapse-compressor/synapse_auto_compressor/ + +RUN cargo build + +FROM alpine + +RUN apk add --no-cache libgcc + +COPY --from=builder /opt/synapse-compressor/target/debug/synapse_compress_state /usr/local/bin/synapse_compress_state +COPY --from=builder /opt/synapse-compressor/target/debug/synapse_auto_compressor /usr/local/bin/synapse_auto_compressor