-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added docker development environment #26669
base: dev
Are you sure you want to change the base?
Conversation
Please re-trigger failed job, i changed the target. |
RUN chmod +x /usr/local/bin/docker-entrypoint.sh | ||
|
||
COPY . /app | ||
RUN pnpm build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will require rebuilding the container every time you change the container, which is not handy. I think it would be best to run npm run build:watch
and an auto restart or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the container is ran with the accompanying compose-file the repository root is bind-mounted into /app
so no rebuild necessary afaict.
You can still run npm run build:watch
in another terminal, or with docker compose -f docker/compose.dev.yml exec zigbee2mqtt npm run build:watch
for running inside the container.
A proper live-reload with the pnpm start
command would probably be preferable but I'm not that comfortable with node.js unfortunately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we can just re-use https://github.com/Koenkk/zigbee2mqtt/blob/master/docker/Dockerfile, as this separate Dockerfile
add some extra maintenance. I think this can be done by specifying the target
in the docker-compose.dev.yaml
. Then the user just has to run pnpm start
to start Z2M
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that seems doable, I'll update when i get some time
While working on the project I did so in docker, thought I'd share my config.
It's probably far from perfect, but it works. Keep it or leave it.
😄