Skip to content

Commit 59c6f80

Browse files
committed
chore: add redis to docker compose files
1 parent bd79c93 commit 59c6f80

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

docker-compose.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,28 @@ services:
33
build: .
44
container_name: nostr-ts-relay
55
environment:
6+
PORT: 8008
7+
NOSTR_CONFIG_DIR: /home/node/
68
DB_HOST: db
79
DB_PORT: 5432
810
DB_USER: nostr_ts_relay
911
DB_PASSWORD: nostr_ts_relay
1012
DB_NAME: nostr_ts_relay
1113
DB_MIN_POOL_SIZE: 2
1214
DB_MAX_POOL_SIZE: 10
13-
NOSTR_CONFIG_DIR: /home/node/
14-
PORT: 8008
15+
REDIS_HOST: cache
16+
REDIS_PORT: 6379
17+
REDIS_USER: default
18+
REDIS_PASSWORD: nostr_ts_relay
19+
DEBUG: "worker:*"
1520
user: node:node
1621
volumes:
1722
- $HOME/.nostr:/home/node/
1823
ports:
1924
- 8008:8008
2025
depends_on:
26+
cache:
27+
condition: service_healthy
2128
db:
2229
condition: service_healthy
2330
migrations:
@@ -43,6 +50,21 @@ services:
4350
interval: 5s
4451
timeout: 5s
4552
retries: 5
53+
cache:
54+
image: redis:7.0.5-alpine3.16
55+
container_name: cache
56+
volumes:
57+
- cache:/data
58+
command: redis-server --save 20 1 --loglevel warning --requirepass nostr_ts_relay
59+
networks:
60+
default:
61+
ipv4_address: 10.10.10.4
62+
restart: always
63+
healthcheck:
64+
test: [ "CMD", "redis-cli", "ping", "|", "grep", "PONG" ]
65+
interval: 1s
66+
timeout: 5s
67+
retries: 5
4668
migrations:
4769
image: node:18-alpine3.16
4870
container_name: migrations
@@ -75,3 +97,4 @@ networks:
7597

7698
volumes:
7799
pgdata:
100+
cache:

test/integration/docker-compose.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ services:
1111
DB_PASSWORD: postgres
1212
DB_MIN_POOL_SIZE: 1
1313
DB_MAX_POOL_SIZE: 2
14+
REDIS_HOST: cache-test
15+
REDIS_PORT: 6379
16+
REDIS_USER: default
17+
REDIS_PASSWORD: nostr_ts_relay_test
1418
NOSTR_CONFIG_DIR: /code
1519
volumes:
1620
- ../../src:/code/src
@@ -19,6 +23,8 @@ services:
1923
- ../../.test-reports:/code/.test-reports
2024
working_dir: /code
2125
depends_on:
26+
cache-test:
27+
condition: service_healthy
2228
db-test:
2329
condition: service_healthy
2430
migrations-test:
@@ -40,6 +46,17 @@ services:
4046
timeout: 5s
4147
start_period: 5s
4248
retries: 0
49+
cache-test:
50+
image: redis:7.0.5-alpine3.16
51+
command: redis-server --save 20 1 --loglevel warning --requirepass nostr_ts_relay_test
52+
networks:
53+
- nostr-ts-relay-test
54+
restart: always
55+
healthcheck:
56+
test: [ "CMD", "redis-cli", "ping", "|", "grep", "PONG" ]
57+
interval: 1s
58+
timeout: 5s
59+
retries: 5
4360
migrations-test:
4461
image: node:18-alpine3.16
4562
environment:

0 commit comments

Comments
 (0)