16 lines
579 B
Docker
16 lines
579 B
Docker
FROM rust:alpine AS builder
|
|
RUN apk add --no-cache musl-dev musl-utils gcc
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
ENV RUSTFLAGS="-C target-feature=+crt-static"
|
|
COPY Cargo.toml Cargo.lock ./
|
|
COPY src ./src
|
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
|
--mount=type=cache,target=/usr/local/cargo/git \
|
|
rustup target add x86_64-unknown-linux-musl && cargo build --release --target x86_64-unknown-linux-musl
|
|
|
|
FROM alpine:latest
|
|
RUN apk add --no-cache libgcc
|
|
COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-musl/release/nostr-relay /usr/local/bin/
|
|
CMD ["nostr-relay"] |