forked from
tangled.org/core
Monorepo for Tangled
919 B
23 lines
1FROM rust:1.96-slim-trixie AS builder
2RUN apt-get update && apt-get install -y --no-install-recommends \
3 ca-certificates pkg-config perl make cmake clang mold \
4 && rm -rf /var/lib/apt/lists/*
5ENV RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold"
6ARG BOBBIN_PROFILE=release
7WORKDIR /src
8COPY Cargo.toml Cargo.lock rust-toolchain.toml ./
9COPY lexicons ./lexicons
10COPY bobbin ./bobbin
11COPY shuttle ./shuttle
12RUN cargo build --profile ${BOBBIN_PROFILE} --bin bobbin --package bobbin
13RUN if [ "${BOBBIN_PROFILE}" = "release" ]; then strip target/${BOBBIN_PROFILE}/bobbin; fi
14
15FROM debian:trixie-slim
16ARG BOBBIN_PROFILE=release
17RUN apt-get update && apt-get install -y --no-install-recommends \
18 ca-certificates \
19 && rm -rf /var/lib/apt/lists/*
20COPY --from=builder /src/target/${BOBBIN_PROFILE}/bobbin /usr/local/bin/bobbin
21ENV BOBBIN_BIND=0.0.0.0:8090
22EXPOSE 8090
23ENTRYPOINT ["/usr/local/bin/bobbin"]