Skip to content

Commit 25acff2

Browse files
author
Inside4ndroid
committed
fix(server): bind to 0.0.0.0; set BIND_HOST for Docker/runtime to expose port
1 parent 0e9f6d9 commit 25acff2

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ARG VERSION=dev
2222
WORKDIR /app
2323
ENV NODE_ENV=production \
2424
API_PORT=8787 \
25+
BIND_HOST=0.0.0.0 \
2526
APP_VERSION=${VERSION}
2627

2728
# Create non-root user

apiServer.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,12 @@ app.get('/api/streams/:provider/:type/:tmdbId', async (req,res) => {
374374
});
375375

376376
const PORT = config.port;
377-
const server = app.listen(PORT, () => {
378-
console.log(`TMDB Embed REST API listening on http://localhost:${PORT}`);
377+
const HOST = process.env.BIND_HOST || '0.0.0.0';
378+
const server = app.listen(PORT, HOST, () => {
379+
console.log(`TMDB Embed REST API listening on http://${HOST}:${PORT}`);
380+
if (HOST !== 'localhost') {
381+
console.log(`Local access (if running on your machine): http://localhost:${PORT}`);
382+
}
379383
console.log('Endpoints:');
380384
console.log(' GET /api/health');
381385
console.log(' GET /api/metrics');

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ services:
99
# Alternative: supply JSON array
1010
# - TMDB_API_KEYS=["key1","key2"]
1111
- API_PORT=8787
12+
- BIND_HOST=0.0.0.0
1213
# FebBox cookies (comma separated) if you want Showbox immediately functional
1314
- FEBBOX_COOKIES=${FEBBOX_COOKIES:-}
1415
ports:

0 commit comments

Comments
 (0)