A deployment with Docker on machine behind VPS with Pangolin
As discovered the Nostr ecosystem felt an urgent need to run my own relay.
Want my relay to accept connections only from a predefined list of allowed npubs, rather than being open to anyone. This requires a whitelist.
As described here the example of Event-sifter plugin provides exactly that capability.
Unfortunately, the docker image does not include Node.js, which is required for the plugin to function.
Because building a fresh image on an updated Alpine base repeatedly fails (the app/strfry package is missing, leaving the image incomplete, assuming this is my fault somewhere), decided to start from the existing image and simply add Node.js and npm to it.
To do this, placed a Dockerfile alongside my docker‑compose.yml. The file contains just two lines:
FROM dockurr/strfry
RUN apk add --no-cache nodejs npm
and run the:
docker build -t strfry-njs .
After this changed docker-compose.yaml image for the new build.
services:
strfry:
image: strfry-njs
In the strfy.conf:
- bind to the 0.0.0.0
In the whitelist.js:
- add hex value for npub (convert it somewhere if client holding the nsec do not show it - Amber show me only npub)
After building the custom image, I added the newt configuration from Pangolin to the docker‑compose.yml, (the required domain and resources are to be done in Pangolin). With those changes in place, the relay should start up and run correctly.
I’m not entirely sure whether this setup is secure/correct; I’d appreciate any suggestions on additional safeguards.
Since the repository doesn’t have a dedicated “Discussion” section, I’m using this issue to share my setup.
It seems to be the simplest way for me and a few friends to run the relay on an old notebook we have lying around.