nostream/docker-compose.yml
Ricardo Arturo Cabral Mejía 52aac39875
feat: implement nodeless payments processor (#305)
* chore: hide powered by zebedee if payment processor is not

* chore: add nodeless as payments processor to settings

* fix: bad content type on zebedee callback req handler

* chore(release): 1.23.0 [skip ci]

# [1.23.0](https://github.com/Cameri/nostream/compare/v1.22.6...v1.23.0) (2023-05-12)

### Bug Fixes

* add SECRET as env variable ([#298](https://github.com/Cameri/nostream/issues/298)) ([58a1254](58a12546f0))
* invoice auto marked as paid ([be6d6f1](be6d6f1454))
* issues with invoices ([#271](https://github.com/Cameri/nostream/issues/271)) ([e1561e7](e1561e78fd))

### Features

* add LNURL processor ([#202](https://github.com/Cameri/nostream/issues/202)) ([f237400](f23740073f))
* allow lightning zap receipts on paid relays ([#303](https://github.com/Cameri/nostream/issues/303)) ([14bc96f](14bc96f516))

* feat: implement nodeless payments processor

* docs: add accepting payments section

* chore: validate nodeless webhook secret

* chore: hide powered-by-zebedee for non-zebedee processors

---------

Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
2023-05-15 08:07:28 -07:00

139 lines
3.7 KiB
YAML

services:
nostream:
build: .
container_name: nostream
environment:
SECRET: ${SECRET}
RELAY_PORT: 8008
# Master
NOSTR_CONFIG_DIR: /home/node/.nostr
DB_HOST: nostream-db
DB_PORT: 5432
DB_USER: nostr_ts_relay
DB_PASSWORD: nostr_ts_relay
DB_NAME: nostr_ts_relay
DB_MIN_POOL_SIZE: 16
DB_MAX_POOL_SIZE: 64
DB_ACQUIRE_CONNECTION_TIMEOUT: 60000
# Read Replica
READ_REPLICAS: 2
READ_REPLICA_ENABLED: 'false'
# Read Replica No. 1
RR0_DB_HOST: db
RR0_DB_PORT: 5432
RR0_DB_USER: nostr_ts_relay
RR0_DB_PASSWORD: nostr_ts_relay
RR0_DB_NAME: nostr_ts_relay
RR0_DB_MIN_POOL_SIZE: 16
RR0_DB_MAX_POOL_SIZE: 64
RR0_DB_ACQUIRE_CONNECTION_TIMEOUT: 10000
# Read Replica No. 2
RR1_DB_HOST: db
RR1_DB_PORT: 5432
RR1_DB_USER: nostr_ts_relay
RR1_DB_PASSWORD: nostr_ts_relay
RR1_DB_NAME: nostr_ts_relay
RR1_DB_MIN_POOL_SIZE: 16
RR1_DB_MAX_POOL_SIZE: 64
RR1_DB_ACQUIRE_CONNECTION_TIMEOUT: 10000
# Add RR2, RR3, etc. to configure more read replicas
# Redis
REDIS_HOST: nostream-cache
REDIS_PORT: 6379
REDIS_USER: default
REDIS_PASSWORD: nostr_ts_relay
TOR_HOST: tor_proxy
TOR_CONTROL_PORT: 9051
TOR_PASSWORD: nostr_ts_relay
HIDDEN_SERVICE_PORT: 80
# Nodeless.io
NODELESS_API_KEY: ${NODELESS_API_KEY}
NODELESS_WEBHOOK_SECRET: ${NODELESS_WEBHOOK_SECRET}
# Enable DEBUG for troubleshooting. Examples:
# DEBUG: "primary:*"
# DEBUG: "worker:*"
# DEBUG: "knex:query"
user: node:node
volumes:
- ${PWD}/.nostr:/home/node/.nostr
ports:
- 127.0.0.1:8008:8008
depends_on:
nostream-cache:
condition: service_healthy
nostream-db:
condition: service_healthy
nostream-migrate:
condition: service_completed_successfully
restart: on-failure
networks:
default:
nostream-db:
image: postgres
container_name: nostream-db
environment:
POSTGRES_DB: nostr_ts_relay
POSTGRES_USER: nostr_ts_relay
POSTGRES_PASSWORD: nostr_ts_relay
volumes:
- ${PWD}/.nostr/data:/var/lib/postgresql/data
- ${PWD}/.nostr/db-logs:/var/log/postgresql
- ${PWD}/postgresql.conf:/postgresql.conf
networks:
default:
command: postgres -c 'config_file=/postgresql.conf'
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U nostr_ts_relay"]
interval: 5s
timeout: 5s
retries: 5
start_period: 360s
nostream-cache:
image: redis:7.0.5-alpine3.16
container_name: nostream-cache
volumes:
- cache:/data
command: redis-server --loglevel warning --requirepass nostr_ts_relay
networks:
default:
restart: always
healthcheck:
test: [ "CMD", "redis-cli", "ping", "|", "grep", "PONG" ]
interval: 1s
timeout: 5s
retries: 5
nostream-migrate:
image: node:18-alpine3.16
container_name: nostream-migrate
environment:
DB_HOST: nostream-db
DB_PORT: 5432
DB_USER: nostr_ts_relay
DB_PASSWORD: nostr_ts_relay
DB_NAME: nostr_ts_relay
entrypoint:
- sh
- -c
- 'cd code && npm install --no-save --quiet knex@2.4.0 pg@8.8.0 && npx knex migrate:latest'
volumes:
- ./migrations:/code/migrations
- ./knexfile.js:/code/knexfile.js
depends_on:
nostream-db:
condition: service_healthy
networks:
default:
ipv4_address: 10.10.10.254
networks:
default:
name: nostream
ipam:
driver: default
config:
- subnet: 10.10.10.0/24
volumes:
cache: