Closed ibnesayeed closed 7 years ago
ah cool! i was actually stepping on your toes today, as i was working on dev docs and noticed some really low-hanging issues with the dockerfile -- any chance you might be able to give it a quick look-over? :) https://github.com/datatogether/coverage/pull/23/files
our convo in slack was that gin wasn't necessary, but curious your thoughts on that -- if you have experience with it being very helpful, maybe we could link to a good setup resource on why/how people can use it?
I have seen #23 already. You can either revert 32863ceb1224fda4feaa1c421f51a816ae33007b in your PR or resolve the conflict later when merging this one.
As far as gin
is concerned, this Dockerfile will not include that in the final build for production (in fact the final build has nothing but the ca-certs and the static coverage
binary in the very minimal Alpine Linux). However, in the development mode it will be present and run by default, but the command can be overwritten to run the coverage
binary instead. I have never used gin
, but it was commented in the Dockerfile, so I looked at its documentation and realized that it can be helpful as it allows hot-reloading. That's why I added it in a way that it can be used optionally.
Corresponding documentation can be updated once these things are in place. I did not add anything in the docs yet because I though someone might be working on that, so it would cause unnecessary conflict.
This reworked Dockerfile is intended to keep the current behavior unchanged while bringing a lot of additional advantages. It has also fixed some issues that were present erlier.
--target=dev
flag at build time. This will havegin
setup in place which can make it a fun experiences if the code is mounted at the appropriate place form the host machine.GOLANG_TAG
andALPINE_TAG
build args (both default tolatest
).