Comments (5)
I believe you need to run it (docker container) in the host mode.
from hap-nodejs.
It might be able to have a look at the official homebridge docker image as an inspiration https://github.com/oznu/docker-homebridge.
The primary problem, most likely, is to make sure that the mDNS advertisements reach the „outside“ of the container. That’s the reason to use the container in host mode as of right now.
from hap-nodejs.
Thanks for the replies!
In my docker-compose
file I added network_mode: host
and removed any other network
, ports
and expose
entries.
To access the container from another service, this might help https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach
extra_hosts:
- "host.docker.internal:host-gateway"
and access via host.docker.internal:<port>
from hap-nodejs.
Hi @buschco
Could you share how your dockerfile or docker-compose turned out, please?
I'm facing the same problem.
from hap-nodejs.
docker-compose.yml
air:
tty: true
stdin_open: true
image: buschco/esp-air-reporter
restart: always
network_mode: host
volumes:
- persist:/persist
Dockerfile
FROM node:18-alpine AS builder
COPY package.json .
COPY index.ts .
COPY yarn.lock .
RUN yarn install --frozen-lockfile
RUN yarn build
FROM node:18-alpine AS runner
COPY --from=builder out/index.js .
EXPOSE 3031 51826
CMD [ "node", "index.js", "3031", "51826"]
index.ts
//...
const httpPort = parseInt(process.argv[2], 10) || 8080;
const homeKitPort = parseInt(process.argv[3], 10) || 51827;
bridge.publish({
username: "0C:4E:19:2C:A3:82",
pincode: "210-21-998",
port: homeKitPort,
});
from hap-nodejs.
Related Issues (20)
- Accessories states in Home App does not update when controlled manually HOT 12
- handleSnapshotRequest reason sometimes passed in as "undefined" HOT 2
- allow to specify a different IP in mDSN advertisement HOT 1
- Special Characters in Name HOT 11
- Node 16 to 18 update - Alpine - Docker - Synology
- node.js update HOT 1
- Node.js Update HOT 1
- Minimum Current Ambient Light Level warning HOT 1
- Lot of mDNS queries HOT 7
- Test permissions on "persist" storage location before publish
- `updateCharacteristic` won't work after `Client connection closed` HOT 11
- lib v1.x.x adding any accessory HomeKit Error HOT 9
- How to update the device status HOT 5
- TypeError: crypto_1.default.getCiphers is not a function at Object../node_modules/hap-nodejs/dist/lib/util/hapCrypto.js HOT 6
- v0.11.0 fails on Synology HOT 15
- VOC Density characteristic incorrectly set as a float and limited to 1000 HOT 4
- Setting Characteristic minValue via setProps results in debug error if the current value is lower than the new minValue HOT 6
- TypeScript plugins do not build with noImplicitAny: true in 1.6.0 HOT 11
- Interpreting Siri Commands HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hap-nodejs.