1 ARG RUST_BUILDER_IMAGE=rust:1.51.0-slim-buster
4 FROM $RUST_BUILDER_IMAGE as builder
6 # Install compilation dependencies
8 && apt-get -y install --no-install-recommends libssl-dev pkg-config libpq-dev \
9 && rm -rf /var/lib/apt/lists/*
14 RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs"
16 RUN cargo build --release
19 RUN strip ./target/release/lemmy_server
21 RUN cp ./target/release/lemmy_server /app/lemmy_server
24 FROM debian:buster-slim as lemmy
26 # Install libpq for postgres
28 && apt-get -y install --no-install-recommends postgresql-client libc6 libssl1.1 \
29 && rm -rf /var/lib/apt/lists/*
31 RUN addgroup --gid 1000 lemmy
32 RUN adduser --no-create-home --shell /bin/sh --uid 1000 --gid 1000 lemmy
35 COPY --chown=lemmy:lemmy --from=builder /app/lemmy_server /app/lemmy
37 RUN chown lemmy:lemmy /app/lemmy