-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (21 loc) · 833 Bytes
/
Copy pathDockerfile
File metadata and controls
28 lines (21 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM rust:1.85-bookworm AS builder
WORKDIR /usr/src/nostrd
COPY Cargo.toml Cargo.lock ./
COPY LICENSE README.md ./
COPY src ./src
RUN cargo build --locked --release
FROM debian:bookworm-slim
RUN groupadd --gid 10001 nostrd \
&& useradd --uid 10001 --gid nostrd --no-create-home \
--home-dir /nonexistent --shell /usr/sbin/nologin nostrd \
&& mkdir -p /data /etc/nostrd \
&& chown nostrd:nostrd /data
COPY --from=builder /usr/src/nostrd/target/release/nostrd /usr/local/bin/nostrd
COPY packaging/docker/nostrd.toml /etc/nostrd/nostrd.toml
USER nostrd:nostrd
VOLUME ["/data"]
EXPOSE 7777
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD ["nostrd", "--config", "/etc/nostrd/nostrd.toml", "healthcheck"]
ENTRYPOINT ["nostrd", "--config", "/etc/nostrd/nostrd.toml"]
CMD ["relay"]