mirror of
https://github.com/Cameri/nostream.git
synced 2025-06-26 08:30:49 +02:00
feat: add docker-compose.yml
This commit is contained in:
parent
d04f6b089c
commit
2733016b78
63
docker-compose.yml
Normal file
63
docker-compose.yml
Normal file
@ -0,0 +1,63 @@
|
||||
services:
|
||||
relay:
|
||||
build: .
|
||||
environment:
|
||||
DB_HOST: db
|
||||
DB_PORT: 5432
|
||||
DB_USER: nostr-ts-relay
|
||||
DB_PASSWORD: nostr-ts-relay
|
||||
DB_NAME: nostr-ts-relay
|
||||
NOSTR_CONFIG_DIR: /nostr
|
||||
volumes:
|
||||
- nostr-config:/nostr
|
||||
ports:
|
||||
- "8008:8008"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
migration:
|
||||
condition: service_completed_successfully
|
||||
networks:
|
||||
- nostr-ts-relay
|
||||
restart: always
|
||||
db:
|
||||
image: postgres
|
||||
environment:
|
||||
POSTGRES_USER: nostr-ts-relay
|
||||
POSTGRES_PASSWORD: nostr-ts-relay
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data/
|
||||
networks:
|
||||
- nostr-ts-relay
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U nostr-ts-relay"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
migration:
|
||||
image: node:18-alpine3.15
|
||||
environment:
|
||||
DB_HOST: db
|
||||
DB_PORT: 5432
|
||||
DB_USER: nostr-ts-relay
|
||||
DB_PASSWORD: nostr-ts-relay
|
||||
DB_NAME: nostr-ts-relay
|
||||
entrypoint:
|
||||
- sh
|
||||
- -c
|
||||
- 'sleep 5s && cd code/ && npm install -g knex && npm run db:migrate'
|
||||
restart: on-failure
|
||||
volumes:
|
||||
- .:/code
|
||||
depends_on:
|
||||
- db
|
||||
networks:
|
||||
- nostr-ts-relay
|
||||
|
||||
networks:
|
||||
nostr-ts-relay:
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
nostr-config:
|
Loading…
x
Reference in New Issue
Block a user