-
Notifications
You must be signed in to change notification settings - Fork 16
tidy up #2
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
base: main
Are you sure you want to change the base?
tidy up #2
Conversation
predbat/Dockerfile.standalone
Outdated
COPY rootfs /wkspace | ||
RUN wget https://codeload.github.com/springfall2008/batpred/zip/refs/heads/main -O main.zip | ||
RUN unzip main.zip | ||
RUN cp batpred-main/apps/predbat/predbat.py predbat.py |
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.
Should this be *.py?
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, with your split design, it should be *py
|
||
WORKDIR /config | ||
COPY rootfs /config | ||
WORKDIR /wkspace |
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.
What's the purpose of the wkspace?
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 is where all the downloaded zip files and extraction takes place. also stores the hass.py etc.. in order to keep the config directory clean. been using it for a while with no problem
I've been thinking the Addon Dockerfiles need a bit of work on GitHub I wouldn't recommend using multiple RUN & COPY commands as each one creates a snapshot of the filesystem which increases the size of the final image I like the idea of separate workdir for the python files keeping them separate from the apps.yaml and log files, this is what I am using in some of the images just that I am using the /addon directory however for the 'latest' tag I have kept the files in /config as that's where they are now This is an extract of that I am using for the Docker Hub image and I see no reason why it cannot be used for the HA Addon as that's just a docker container but would need a few tweaks and to be tested The run file then just moves thing about checks files are there, that apps.yaml is modified and starts predbat I am away at the moment but happy to look at more details when I get back # Use the official Ubuntu image # Set shell # Install Python and required packages # Set the working directory # Copy the rootfs directory to /addon # Make the startup script executable |
separate working directory and config directories. config directory to be mounted via docker -v. added coder compose file. also mounting /etc/localtime to ensure correct timezone.
Note: not sure how this will react to HA Addon build. sorry cannot test as i dont use HAOS. also not sure what the naming convensions are.