docker-compose
and post-commit
git
hook
A simple way to rebuild your web app container on every commit with local - Initialize your
git
repo withgit init
- Place the attached
post-commit
file into.git/hooks/
directory and make it executable withchmod +x .git/hooks/post-commit
- Use the attached
docker-compose.yaml
andDockerfile
as examples to create and run container - The
.env
file is not commited to VCS as it may contain secure configuration details. Put variables there like the following ones:APPNAME=myapp
APPVERSION=latest
post-commit
working directory is the repo root, it is the same one where.git
is located- The
post-commit
script is Linux and MacOS compartible - Logs for building and running container is available in
/tmp/git-post-commit
asAPPNAME-YYYYMMDD-HHMMSS-XXX
files - Link to the Repo