Skip to content

Commit

Permalink
Update to include optional exposure to devices on local network by up…
Browse files Browse the repository at this point in the history
…dating HOST_BIND env variable
  • Loading branch information
glassBead-tc committed Dec 4, 2024
1 parent 854c146 commit 99b8e75
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions .changeset/dirty-hotels-press.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
'srcbook': patch
---

Added network exposure configuration to enable accessing Srcbook from other devices when running in Docker. This includes:
Added configurable network exposure for Docker deployments with secure defaults. This includes:

- Added docker-compose.yml with 0.0.0.0 binding configuration
- Configured port mapping to expose port 2150 to the network
- Set HOST environment variable for external network access
- Added docker-compose.yml with configurable network binding
- Default configuration restricts access to localhost (127.0.0.1) for security
- Optional network exposure via HOST_BIND environment variable
- Configured port 2150 mapping for Docker container

This change allows users to access their Srcbook instance from other devices on their network when running in Docker.
Users can optionally expose their Srcbook instance to other network devices by setting HOST_BIND=0.0.0.0 when running Docker.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
context: .
dockerfile: Dockerfile
ports:
- "0.0.0.0:2150:2150"
- "${HOST_BIND:-127.0.0.1}:2150:2150"
volumes:
- type: bind
source: ~/.srcbook
Expand All @@ -14,6 +14,6 @@ services:
create_host_path: true
environment:
- NODE_ENV=production
- HOST=0.0.0.0
- HOST=${HOST_BIND:-127.0.0.1}
- SRCBOOK_INSTALL_DEPS=true
command: ["pnpm", "start"]

0 comments on commit 99b8e75

Please sign in to comment.