Skip to content

Commit 4c93795

Browse files
committed
fix(docker): restore bind-mount for postgres data, add windows override
- Revert nostream-db data volume from named volume back to bind-mount (\C:\Users\ckodi\Desktop\nostream/.nostr/data) to avoid breaking existing installations - Keep postgres:15 image pin from previous commit (non-breaking improvement) - Add docker-compose.windows.yml override for Windows/WSL2 users where bind-mounts cause PostgreSQL permission errors; uses named volume nostream-db-data instead - Windows users can run: docker compose -f docker-compose.yml -f docker-compose.windows.yml up --build or set COMPOSE_FILE in .env: COMPOSE_FILE=docker-compose.yml:docker-compose.windows.yml
1 parent d64e4be commit 4c93795

2 files changed

Lines changed: 32 additions & 5 deletions

File tree

docker-compose.windows.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# docker-compose.windows.yml
2+
#
3+
# Windows / WSL2 override for Nostream.
4+
#
5+
# On Windows (including WSL2), Docker bind-mounts to host paths can cause
6+
# PostgreSQL permission errors. This override replaces the bind-mount for
7+
# PostgreSQL data with a named Docker volume, which is managed entirely
8+
# by the Docker engine and avoids those issues.
9+
#
10+
# Usage:
11+
# docker compose -f docker-compose.yml -f docker-compose.windows.yml up --build
12+
#
13+
# Or set COMPOSE_FILE in your .env:
14+
# COMPOSE_FILE=docker-compose.yml:docker-compose.windows.yml
15+
#
16+
# WARNING: If you previously ran Nostream with the default docker-compose.yml
17+
# your data is in .nostr/data/ on the host. Before switching to this file,
18+
# migrate your data or it will not be accessible from the named volume.
19+
20+
services:
21+
nostream-db:
22+
volumes:
23+
- nostream-db-data:/var/lib/postgresql/data
24+
- ${PWD}/.nostr/db-logs:/var/log/postgresql
25+
- ${PWD}/postgresql.conf:/postgresql.conf
26+
27+
volumes:
28+
nostream-db-data:

docker-compose.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ services:
1717
DB_ACQUIRE_CONNECTION_TIMEOUT: 60000
1818
# Read Replica
1919
READ_REPLICAS: 2
20-
READ_REPLICA_ENABLED: "false"
20+
READ_REPLICA_ENABLED: 'false'
2121
# Read Replica No. 1
2222
RR0_DB_HOST: db
2323
RR0_DB_PORT: 5432
@@ -84,7 +84,7 @@ services:
8484
POSTGRES_USER: nostr_ts_relay
8585
POSTGRES_PASSWORD: nostr_ts_relay
8686
volumes:
87-
- nostream-db-data:/var/lib/postgresql/data
87+
- ${PWD}/.nostr/data:/var/lib/postgresql/data
8888
- ${PWD}/.nostr/db-logs:/var/log/postgresql
8989
- ${PWD}/postgresql.conf:/postgresql.conf
9090
networks:
@@ -108,7 +108,7 @@ services:
108108
default:
109109
restart: always
110110
healthcheck:
111-
test: ["CMD", "redis-cli", "ping", "|", "grep", "PONG"]
111+
test: [ "CMD", "redis-cli", "ping", "|", "grep", "PONG" ]
112112
interval: 1s
113113
timeout: 5s
114114
retries: 5
@@ -125,7 +125,7 @@ services:
125125
entrypoint:
126126
- sh
127127
- -c
128-
- "cd code && npm install --no-save --quiet knex@2.4.0 pg@8.8.0 && npx knex migrate:latest"
128+
- 'cd code && npm install --no-save --quiet knex@2.4.0 pg@8.8.0 && npx knex migrate:latest'
129129
volumes:
130130
- ./migrations:/code/migrations
131131
- ./knexfile.js:/code/knexfile.js
@@ -145,4 +145,3 @@ networks:
145145

146146
volumes:
147147
cache:
148-
nostream-db-data:

0 commit comments

Comments
 (0)