Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
946 B · 28 lines
at sl/gitmirror
1234567891011121314151617181920212223242526272829# Development only. Not for production use.
FROM rust:1.96-bookworm AS build
WORKDIR /srcCOPY . .
ENV SQLX_OFFLINE=true
# Cache mounts on the cargo registry + target dir. The binary is copied out within the same# RUN because the target cache mount is unmounted afterwards (a later COPY --from could not# see it).RUN --mount=type=cache,target=/usr/local/cargo/registry \ --mount=type=cache,target=/src/target \ cargo build --release -p gitmirror \ && cp /src/target/release/gitmirror /usr/local/bin/gitmirror
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates tini \ && rm -rf /var/lib/apt/lists/*
COPY --from=build /usr/local/bin/gitmirror /usr/local/bin/gitmirror
EXPOSE 9001
ENTRYPOINT ["/usr/bin/tini", "--"]CMD ["sh", "-c", "if [ -f /usr/local/share/ca-certificates/caddy.crt ]; then update-ca-certificates; fi && exec /usr/local/bin/gitmirror serve"]