a73x

Dockerfile

Ref:   Size: 892 B   History

FROM rust:1.88-bookworm AS builder

# The build context has no `.git/` (see `.dockerignore`), so `build.rs` cannot
# discover the commit and `--version` in the running container would name only
# the crate version. Whoever starts the build does know the commit, so they pass
# it: `make docker` does this from `git rev-parse`. Left unset, both arrive as
# empty strings, which `build.rs` reads as "not given" and degrades exactly as a
# release tarball does.
ARG GIT_COMMIT
ARG GIT_DIRTY
ENV GIT_COLLAB_BUILD_COMMIT=$GIT_COMMIT
ENV GIT_COLLAB_BUILD_DIRTY=$GIT_DIRTY

WORKDIR /build
COPY . .
RUN cargo build --release --bin git-collab-server

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y git libssl3 ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /build/target/release/git-collab-server /usr/local/bin/
EXPOSE 8080 22
ENTRYPOINT ["git-collab-server"]