fritzcollectd
fritzcollectd copied to clipboard
docker: Add Docker configuration
This PR adds Docker configuration for fritzcollectd. Thanks @redm123, @lnxbil.
I've mostly taken over your ideas with a few enhancements. Most noticeable is that when the image is used through docker-compose.yml, it's using the current development version (by mounting the python plugin file into the container). This helps me to quickly test changes to the plugin.
This closes #26, #29, #14.
Coverage remained the same at 100.0% when pulling 2b9356eed0e7a3435b8eec9e65381112138cdc75 on docker into 1368894e957eb743f76777707249dd2f50447713 on master.
Coverage remained the same at 100.0% when pulling 2b9356eed0e7a3435b8eec9e65381112138cdc75 on docker into 1368894e957eb743f76777707249dd2f50447713 on master.
Sorry for the comment spam but I thought most of those are useful and prevent common mistakes and pitfalls. :)
Also to easily do dev you could just copy in the project at build time with good caching and tag release versions. Would solve one of my comments, too and is way cleaner. Let me know if you wan't some input or help with that.
I noticed an error that occurs with docker-compose. Can you confirm that? #37
@SuperSandro2000 Thanks for your valuable comments!
I guess I need to spend more time on the dev environment. Properly installing the project at build time caused a headache. I'm using pbr which automatically manages the project version (from git revisions). However doing an install requires git to be installed and the .git directory has to be copied into the container. I'll try to see if I find a better solution.
I usually get git repos in docker container by one of those two ways:
RUN apk add git && git clone --depth=1 something /app && RUN pip3 install -r /app/requirements.txt && apk del git
or
COPY [ "requirements.txt", "/app/" ]
RUN pip3 install -r /app/requirements.txt
COPY [ ".", "/app/" ]
The second one is only good if you have the project in the same repo with the Dockerfiles cause otherwise you need to clone it beforehand with a script.
@fetzerch Have you been able to make progress, or do you need support?