2022-10-12 01:19:44 +00:00
|
|
|
services:
|
2023-01-27 02:57:20 -05:00
|
|
|
nostream:
|
2022-10-12 01:19:44 +00:00
|
|
|
build: .
|
2023-01-27 02:57:20 -05:00
|
|
|
container_name: nostream
|
2022-10-12 01:19:44 +00:00
|
|
|
environment:
|
2023-05-05 22:18:28 +02:00
|
|
|
SECRET: ${SECRET}
|
2022-12-21 01:28:42 -05:00
|
|
|
RELAY_PORT: 8008
|
2023-01-25 00:13:01 -05:00
|
|
|
# Master
|
2023-01-27 02:57:20 -05:00
|
|
|
NOSTR_CONFIG_DIR: /home/node/.nostr
|
|
|
|
DB_HOST: nostream-db
|
2022-10-12 01:19:44 +00:00
|
|
|
DB_PORT: 5432
|
2022-10-17 04:35:12 +00:00
|
|
|
DB_USER: nostr_ts_relay
|
|
|
|
DB_PASSWORD: nostr_ts_relay
|
|
|
|
DB_NAME: nostr_ts_relay
|
2022-12-20 22:53:30 -05:00
|
|
|
DB_MIN_POOL_SIZE: 16
|
2022-12-27 16:18:31 -05:00
|
|
|
DB_MAX_POOL_SIZE: 64
|
2023-01-17 18:50:20 -05:00
|
|
|
DB_ACQUIRE_CONNECTION_TIMEOUT: 60000
|
2023-01-25 00:13:01 -05:00
|
|
|
# Read Replica
|
2023-05-12 19:49:51 -04:00
|
|
|
READ_REPLICAS: 2
|
2023-01-25 00:13:01 -05:00
|
|
|
READ_REPLICA_ENABLED: 'false'
|
2023-04-08 17:50:26 -04:00
|
|
|
# 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
|
2023-05-12 19:49:51 -04:00
|
|
|
# Add RR2, RR3, etc. to configure more read replicas
|
2023-01-25 00:13:01 -05:00
|
|
|
# Redis
|
2023-01-27 02:57:20 -05:00
|
|
|
REDIS_HOST: nostream-cache
|
2022-11-14 23:02:46 -05:00
|
|
|
REDIS_PORT: 6379
|
|
|
|
REDIS_USER: default
|
|
|
|
REDIS_PASSWORD: nostr_ts_relay
|
2022-12-24 19:35:00 +01:00
|
|
|
TOR_HOST: tor_proxy
|
|
|
|
TOR_CONTROL_PORT: 9051
|
|
|
|
TOR_PASSWORD: nostr_ts_relay
|
|
|
|
HIDDEN_SERVICE_PORT: 80
|
2023-05-23 11:08:16 -04:00
|
|
|
# Payments Processors
|
|
|
|
# Zebedee
|
|
|
|
ZEBEDEE_API_KEY: ${ZEBEDEE_API_KEY}
|
2023-05-15 11:07:28 -04:00
|
|
|
# Nodeless.io
|
|
|
|
NODELESS_API_KEY: ${NODELESS_API_KEY}
|
|
|
|
NODELESS_WEBHOOK_SECRET: ${NODELESS_WEBHOOK_SECRET}
|
2023-05-23 11:08:16 -04:00
|
|
|
# OpenNode
|
|
|
|
OPENNODE_API_KEY: ${OPENNODE_API_KEY}
|
|
|
|
# Lnbits
|
|
|
|
LNBITS_API_KEY: ${LNBITS_API_KEY}
|
2022-12-23 02:17:19 -05:00
|
|
|
# Enable DEBUG for troubleshooting. Examples:
|
2022-12-28 14:33:22 +01:00
|
|
|
# DEBUG: "primary:*"
|
2022-12-23 02:17:19 -05:00
|
|
|
# DEBUG: "worker:*"
|
|
|
|
# DEBUG: "knex:query"
|
2022-10-17 04:35:12 +00:00
|
|
|
user: node:node
|
2022-10-12 01:19:44 +00:00
|
|
|
volumes:
|
2023-01-27 02:57:20 -05:00
|
|
|
- ${PWD}/.nostr:/home/node/.nostr
|
2022-10-12 01:19:44 +00:00
|
|
|
ports:
|
2023-02-10 14:55:10 -05:00
|
|
|
- 127.0.0.1:8008:8008
|
2022-10-12 01:19:44 +00:00
|
|
|
depends_on:
|
2023-01-27 02:57:20 -05:00
|
|
|
nostream-cache:
|
2022-11-14 23:02:46 -05:00
|
|
|
condition: service_healthy
|
2023-01-27 02:57:20 -05:00
|
|
|
nostream-db:
|
2022-10-12 01:19:44 +00:00
|
|
|
condition: service_healthy
|
2023-01-27 02:57:20 -05:00
|
|
|
nostream-migrate:
|
2022-10-12 01:19:44 +00:00
|
|
|
condition: service_completed_successfully
|
2022-11-06 19:30:12 -05:00
|
|
|
restart: on-failure
|
2022-10-12 01:19:44 +00:00
|
|
|
networks:
|
2022-11-06 19:30:12 -05:00
|
|
|
default:
|
2024-10-22 09:09:34 -04:00
|
|
|
|
2023-01-27 02:57:20 -05:00
|
|
|
nostream-db:
|
2023-01-25 00:13:01 -05:00
|
|
|
image: postgres
|
2023-01-27 02:57:20 -05:00
|
|
|
container_name: nostream-db
|
2022-10-12 01:19:44 +00:00
|
|
|
environment:
|
2022-12-20 22:53:30 -05:00
|
|
|
POSTGRES_DB: nostr_ts_relay
|
2022-10-17 04:35:12 +00:00
|
|
|
POSTGRES_USER: nostr_ts_relay
|
|
|
|
POSTGRES_PASSWORD: nostr_ts_relay
|
2022-10-12 01:19:44 +00:00
|
|
|
volumes:
|
2022-12-20 22:53:30 -05:00
|
|
|
- ${PWD}/.nostr/data:/var/lib/postgresql/data
|
|
|
|
- ${PWD}/.nostr/db-logs:/var/log/postgresql
|
|
|
|
- ${PWD}/postgresql.conf:/postgresql.conf
|
2022-10-12 01:19:44 +00:00
|
|
|
networks:
|
2022-11-06 19:30:12 -05:00
|
|
|
default:
|
2022-12-20 22:53:30 -05:00
|
|
|
command: postgres -c 'config_file=/postgresql.conf'
|
2022-10-12 01:19:44 +00:00
|
|
|
restart: always
|
|
|
|
healthcheck:
|
2022-10-17 04:35:12 +00:00
|
|
|
test: ["CMD-SHELL", "pg_isready -U nostr_ts_relay"]
|
2022-10-12 01:19:44 +00:00
|
|
|
interval: 5s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
2022-12-20 22:53:30 -05:00
|
|
|
start_period: 360s
|
2024-10-22 09:09:34 -04:00
|
|
|
|
2023-01-27 02:57:20 -05:00
|
|
|
nostream-cache:
|
2022-11-14 23:02:46 -05:00
|
|
|
image: redis:7.0.5-alpine3.16
|
2023-01-27 02:57:20 -05:00
|
|
|
container_name: nostream-cache
|
2022-11-14 23:02:46 -05:00
|
|
|
volumes:
|
|
|
|
- cache:/data
|
2023-01-14 22:43:54 -05:00
|
|
|
command: redis-server --loglevel warning --requirepass nostr_ts_relay
|
2022-11-14 23:02:46 -05:00
|
|
|
networks:
|
|
|
|
default:
|
|
|
|
restart: always
|
|
|
|
healthcheck:
|
|
|
|
test: [ "CMD", "redis-cli", "ping", "|", "grep", "PONG" ]
|
|
|
|
interval: 1s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
2024-10-22 09:09:34 -04:00
|
|
|
|
2023-01-27 02:57:20 -05:00
|
|
|
nostream-migrate:
|
2022-11-06 19:30:12 -05:00
|
|
|
image: node:18-alpine3.16
|
2023-01-27 02:57:20 -05:00
|
|
|
container_name: nostream-migrate
|
2022-10-12 01:19:44 +00:00
|
|
|
environment:
|
2023-01-27 02:57:20 -05:00
|
|
|
DB_HOST: nostream-db
|
2022-10-12 01:19:44 +00:00
|
|
|
DB_PORT: 5432
|
2022-10-17 04:35:12 +00:00
|
|
|
DB_USER: nostr_ts_relay
|
|
|
|
DB_PASSWORD: nostr_ts_relay
|
|
|
|
DB_NAME: nostr_ts_relay
|
2022-10-12 01:19:44 +00:00
|
|
|
entrypoint:
|
|
|
|
- sh
|
|
|
|
- -c
|
2023-01-13 23:38:30 -05:00
|
|
|
- 'cd code && npm install --no-save --quiet knex@2.4.0 pg@8.8.0 && npx knex migrate:latest'
|
2022-10-12 01:19:44 +00:00
|
|
|
volumes:
|
2022-10-17 04:35:12 +00:00
|
|
|
- ./migrations:/code/migrations
|
|
|
|
- ./knexfile.js:/code/knexfile.js
|
2022-10-12 01:19:44 +00:00
|
|
|
depends_on:
|
2023-01-27 02:57:20 -05:00
|
|
|
nostream-db:
|
2022-12-20 22:53:30 -05:00
|
|
|
condition: service_healthy
|
2022-10-12 01:19:44 +00:00
|
|
|
networks:
|
2022-11-06 19:30:12 -05:00
|
|
|
default:
|
2023-01-27 02:57:20 -05:00
|
|
|
|
2022-10-12 01:19:44 +00:00
|
|
|
networks:
|
2022-11-06 19:30:12 -05:00
|
|
|
default:
|
2023-01-27 02:57:20 -05:00
|
|
|
name: nostream
|
2022-11-06 19:30:12 -05:00
|
|
|
ipam:
|
|
|
|
driver: default
|
|
|
|
config:
|
|
|
|
- subnet: 10.10.10.0/24
|
2022-10-12 01:19:44 +00:00
|
|
|
|
|
|
|
volumes:
|
2022-12-20 22:53:30 -05:00
|
|
|
cache:
|