Skip to content
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

Specify dashboard port for docker container #2718

Open
vincentkoevoets opened this issue May 15, 2024 · 1 comment
Open

Specify dashboard port for docker container #2718

vincentkoevoets opened this issue May 15, 2024 · 1 comment

Comments

@vincentkoevoets
Copy link

Describe the problem you have/What new integration you would like

I'd like the possibility to specify the dashboard port number in the docker container. We can already put our username and password in an environment variable, so why not the port number?

Please describe your use case for this integration and alternatives you've tried:

I always move away from standard port numbers on any docker container I use, but with the esphome docker container, this is not possible.
One workaround is to add this command to the compose file:

command: "dashboard /config --port ${ESPHOME_PORT} --username ${ESPHOME_USER} --password ${ESPHOME_PASS}"

The dashboard is started this way with my specified port number, but now the healtcheck fails as this is still done on port 6052.

Additional context

@srwareham
Copy link

srwareham commented Jun 5, 2024

I have a similar use case. Digging through the code a bit it seems as though the variable handling for password and username have somewhat special handling and are stored in instance variables. This also means the variables can be set by environment variables.

Maybe a solution would be to have port also be passable as an environment variable. This could be more easily picked up by the healthcheck and the dashboard starts code ? It seems the default port is defined by the actual ArgParse argparser here currently. There also seems to be precedent with ESPHOME_DASHBOARD_USE_PING, ESPHOME_DASHBOARD_RELATIVE_URL and ESPHOME_DASHBOARD_USE_MQTT.

Would the maintainers find this acceptable? This could probably also scale to other dashboard parameters and could be passed in to docker compose or docker run commands more easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants