Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,20 @@ services:
- ${RELAY_CONF}:/etc/strfry.conf:ro
- ${RELAY_DATA}/db:/app/strfry-db:rw
network_mode: service:tor
# Container hardening: the relay is internet-facing (serves the order book,
# NIP-17 notifications, order chat and federation sync) and runs as root.
# Drop capabilities (cron only needs SETUID/SETGID to execute the sync jobs)
# and prevent privilege escalation.
cap_drop:
- ALL
cap_add:
- SETUID
- SETGID
security_opt:
- no-new-privileges:true
mem_limit: 1g
cpus: "2.0"
pids_limit: 200

# Example simple backup service (copy/paste to attached storage locations)
backup:
Expand Down
22 changes: 16 additions & 6 deletions compose/relay/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
FROM ubuntu:jammy
FROM ubuntu:noble AS build
ENV TZ=Europe/London

RUN apt update && apt install -y --no-install-recommends \
git g++ make pkg-config libtool ca-certificates \
libssl-dev zlib1g-dev liblmdb-dev libflatbuffers-dev \
libsecp256k1-dev libzstd-dev
libsecp256k1-dev libzstd-dev \
&& rm -rf /var/lib/apt/lists/*

# setup app
RUN git clone --branch 1.0.4 --single-branch https://github.com/hoytech/strfry /app
RUN git clone --branch 1.1.3 --single-branch https://github.com/hoytech/strfry /build

WORKDIR /app
WORKDIR /build

RUN git submodule update --init
RUN make setup-golpe
RUN make clean
RUN make -j4

RUN apt update && apt install -y --no-install-recommends \
liblmdb0 libflatbuffers1 libsecp256k1-0 libb2-1 libzstd1 torsocks cron\
FROM ubuntu:noble
ENV TZ=Europe/London

RUN DEBIAN_FRONTEND=noninteractive apt update \
&& DEBIAN_FRONTEND=noninteractive apt upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
liblmdb0 libflatbuffers2 libsecp256k1-1 libssl3 libb2-1 libzstd1 torsocks cron \
&& rm -rf /var/lib/apt/lists/*

# setup app (binary only, build toolchain stays in the build stage)
COPY --from=build /build/strfry /app/strfry
RUN mkdir -p /app/strfry-db

RUN echo "TorAddress 127.0.0.1" >> /etc/tor/torsocks.conf
RUN echo "TorPort 9050" >> /etc/tor/torsocks.conf

Expand Down
Loading