nostream/docker-compose.yml

100 lines
2.3 KiB
YAML
Raw Permalink Normal View History

2022-10-12 01:19:44 +00:00
services:
relay:
build: .
2022-10-17 04:35:12 +00:00
container_name: nostr-ts-relay
2022-10-12 01:19:44 +00:00
environment:
PORT: 8008
NOSTR_CONFIG_DIR: /home/node/
2022-10-12 01:19:44 +00:00
DB_HOST: db
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-11-12 14:46:30 -05:00
DB_MIN_POOL_SIZE: 2
DB_MAX_POOL_SIZE: 10
REDIS_HOST: cache
REDIS_PORT: 6379
REDIS_USER: default
REDIS_PASSWORD: nostr_ts_relay
DEBUG: "worker:*"
2022-10-17 04:35:12 +00:00
user: node:node
2022-10-12 01:19:44 +00:00
volumes:
2022-10-17 04:35:12 +00:00
- $HOME/.nostr:/home/node/
2022-10-12 01:19:44 +00:00
ports:
2022-11-06 19:30:12 -05:00
- 8008:8008
2022-10-12 01:19:44 +00:00
depends_on:
cache:
condition: service_healthy
2022-10-12 01:19:44 +00:00
db:
condition: service_healthy
2022-10-17 04:35:12 +00:00
migrations:
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:
ipv4_address: 10.10.10.2
2022-10-12 01:19:44 +00:00
db:
image: postgres
2022-10-17 04:35:12 +00:00
container_name: db
2022-10-12 01:19:44 +00:00
environment:
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-10-17 04:35:12 +00:00
- pgdata:/var/lib/postgresql/data/
2022-10-12 01:19:44 +00:00
networks:
2022-11-06 19:30:12 -05:00
default:
ipv4_address: 10.10.10.3
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
cache:
image: redis:7.0.5-alpine3.16
container_name: cache
volumes:
- cache:/data
command: redis-server --save 20 1 --loglevel warning --requirepass nostr_ts_relay
networks:
default:
ipv4_address: 10.10.10.4
restart: always
healthcheck:
test: [ "CMD", "redis-cli", "ping", "|", "grep", "PONG" ]
interval: 1s
timeout: 5s
retries: 5
2022-10-17 04:35:12 +00:00
migrations:
2022-11-06 19:30:12 -05:00
image: node:18-alpine3.16
2022-10-17 04:35:12 +00:00
container_name: migrations
2022-10-12 01:19:44 +00:00
environment:
DB_HOST: db
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
2022-11-11 20:24:16 -05:00
- 'cd code && npm install --no-save --quiet knex@2.3.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:
- db
networks:
2022-11-06 19:30:12 -05:00
default:
ipv4_address: 10.10.10.254
2022-10-12 01:19:44 +00:00
networks:
2022-11-06 19:30:12 -05:00
default:
name: nostr-ts-relay
ipam:
driver: default
config:
- subnet: 10.10.10.0/24
2022-10-12 01:19:44 +00:00
volumes:
2022-10-17 04:35:12 +00:00
pgdata:
cache: