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