Dockerfile.nostr-rs-relay raw
1 FROM rust:alpine AS builder
2
3 RUN apk add --no-cache musl-dev sqlite-dev build-base autoconf automake libtool protobuf-dev protoc
4
5 WORKDIR /build
6 COPY . .
7
8 # Regenerate Cargo.lock if needed, then build
9 RUN rm -f Cargo.lock && cargo generate-lockfile && cargo build --release
10
11 FROM alpine:latest
12 RUN apk --no-cache add ca-certificates sqlite wget
13 WORKDIR /app
14 COPY --from=builder /build/target/release/nostr-rs-relay /app/
15 RUN mkdir -p /data
16
17 EXPOSE 8080
18 ENV RUST_LOG=info
19
20 HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
21 CMD wget --quiet --tries=1 --spider http://localhost:8080 || exit 1
22
23 CMD ["/app/nostr-rs-relay"]
24