22 lines
885 B
Docker
22 lines
885 B
Docker
# Default (non-rns) build only: microReticulum's cmake/C++ build isn't set
|
|
# up for the musl toolchain alpine gives us, mirroring packages.static in
|
|
# flake.nix. Use the Nix flake if you need the rns feature.
|
|
FROM rust:1-alpine AS builder
|
|
RUN apk add --no-cache musl-dev gcc
|
|
WORKDIR /usr/src/bunshin
|
|
COPY Cargo.toml Cargo.lock build.rs ./
|
|
COPY src ./src
|
|
RUN cargo build --release --locked
|
|
|
|
FROM alpine:3.20
|
|
RUN apk add --no-cache ca-certificates \
|
|
&& adduser -D -h /data -u 10000 bunshin
|
|
COPY --from=builder /usr/src/bunshin/target/release/bunshin /usr/local/bin/bunshin
|
|
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
USER bunshin
|
|
WORKDIR /data
|
|
VOLUME /data
|
|
EXPOSE 1961/tcp
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
|
CMD ["serve", "--key", "/data/server.key", "--db", "/data/mail.db", "--host", "0.0.0.0", "--port", "1961"]
|