nostrexをdockerで立てる
elixirもphoenixも知らないので色々間違ってるかもしれない。

1. リポジトリをクローンする
bashgit clone https://github.com/RiverFinancial/nostrex && cd nostrex
2. Dockerfile
のIPv6を無効にする
diffdiff --git a/Dockerfile b/Dockerfile
index 3f31fe0..84a7360 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -92,5 +92,5 @@ USER nobody
CMD ["/app/bin/server"]
# Appended by flyctl
-ENV ECTO_IPV6 true
-ENV ERL_AFLAGS "-proto_dist inet6_tcp"
+# ENV ECTO_IPV6 true
+# ENV ERL_AFLAGS "-proto_dist inet6_tcp"
3. docker-compose.yml
を作る
本番運用する際は SECRET_KEY_BASE
を mix phx.gen.secret
で生成してよしなに管理してほしい。
docker-compose.ymlversion: '3'
services:
nostrex:
build: .
ports:
- "4000:4000"
entrypoint: |
bash -c "/app/bin/migrate && /app/bin/server"
environment:
DATABASE_URL: ecto://user:password@nostrex-db:5432/nostrex
SECRET_KEY_BASE: foobar
nostrex-db:
image: postgres
volumes:
- db:/var/lib/postgresql/data
ports:
- '5432:5432'
environment:
POSTGRES_DB: nostrex
POSTGRES_USER: user
POSTGRES_PASSWORD: password
volumes:
db:
driver: local
4. 起動する
5. 動作確認をする (動かない)
色々試行してみたけどEOSEが返らない仕様かもしれない

bash echo '["REQ", "test", {"limit": 0}]' | websocat -n ws://localhost:4000 # 空のリクエスト
# ["EOSE","test"] が出力されるはず…だが["NOTICE", "successfully created subscription test"]が出る