Fix: Reply; Add: Docker build
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "nostr-relay"
|
name = "nostr-relay"
|
||||||
version = "0.0.2"
|
version = "0.0.3"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
+6
-1
@@ -5,10 +5,15 @@ WORKDIR /usr/src/app
|
|||||||
|
|
||||||
ENV RUSTFLAGS="-C target-feature=+crt-static"
|
ENV RUSTFLAGS="-C target-feature=+crt-static"
|
||||||
COPY Cargo.toml Cargo.lock ./
|
COPY Cargo.toml Cargo.lock ./
|
||||||
|
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 fetch --locked --target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
--mount=type=cache,target=/usr/local/cargo/git \
|
--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
|
cargo build --release --target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
RUN apk add --no-cache libgcc
|
RUN apk add --no-cache libgcc
|
||||||
|
|||||||
+2
-1
@@ -544,7 +544,8 @@ impl RelayMessage {
|
|||||||
sub_id: &str,
|
sub_id: &str,
|
||||||
to_client_msg_tx: &mpsc::Sender<String>,
|
to_client_msg_tx: &mpsc::Sender<String>,
|
||||||
) {
|
) {
|
||||||
let msg = "[\"EVENT\", \"".to_string() + sub_id + "\", " + &event.serialize() + "]";
|
let event = serde_json::to_string(event).unwrap();
|
||||||
|
let msg = "[\"EVENT\", \"".to_string() + sub_id + "\", " + &event + "]";
|
||||||
if let Err(e) = to_client_msg_tx.send(msg).await {
|
if let Err(e) = to_client_msg_tx.send(msg).await {
|
||||||
error!("Failed to send message: {}", e);
|
error!("Failed to send message: {}", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user