24 lines
644 B
Docker
24 lines
644 B
Docker
FROM rust:alpine AS builder
|
|
|
|
RUN apk add --no-cache musl-dev sqlite-dev build-base autoconf automake libtool protobuf-dev protoc
|
|
|
|
WORKDIR /build
|
|
COPY . .
|
|
|
|
# Regenerate Cargo.lock if needed, then build
|
|
RUN rm -f Cargo.lock && cargo generate-lockfile && cargo build --release
|
|
|
|
FROM alpine:latest
|
|
RUN apk --no-cache add ca-certificates sqlite wget
|
|
WORKDIR /app
|
|
COPY --from=builder /build/target/release/nostr-rs-relay /app/
|
|
RUN mkdir -p /data
|
|
|
|
EXPOSE 8080
|
|
ENV RUST_LOG=info
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
CMD wget --quiet --tries=1 --spider http://localhost:8080 || exit 1
|
|
|
|
CMD ["/app/nostr-rs-relay"]
|