Skip to content

Commit 36913a4

Browse files
authored
Fix issue #451: Configure host address for optional exposure outside container in Docker (#460)
* Add Docker support with network exposure * Add Docker support with network exposure * Revise changeset * Update to include optional exposure to devices on local network by updating HOST_BIND env variable
1 parent 567b65f commit 36913a4

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

.changeset/dirty-hotels-press.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'srcbook': patch
3+
---
4+
5+
Added configurable network exposure for Docker deployments with secure defaults. This includes:
6+
7+
- Added docker-compose.yml with configurable network binding
8+
- Default configuration restricts access to localhost (127.0.0.1) for security
9+
- Optional network exposure via HOST_BIND environment variable
10+
- Configured port 2150 mapping for Docker container
11+
12+
Users can optionally expose their Srcbook instance to other network devices by setting HOST_BIND=0.0.0.0 when running Docker.

docker-compose.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: '3'
2+
services:
3+
srcbook:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
ports:
8+
- "${HOST_BIND:-127.0.0.1}:2150:2150"
9+
volumes:
10+
- type: bind
11+
source: ~/.srcbook
12+
target: /root/.srcbook
13+
bind:
14+
create_host_path: true
15+
environment:
16+
- NODE_ENV=production
17+
- HOST=${HOST_BIND:-127.0.0.1}
18+
- SRCBOOK_INSTALL_DEPS=true
19+
command: ["pnpm", "start"]

0 commit comments

Comments
 (0)