NAS Git Deploy (sample)
This folder contains a sample post-receive hook for deploying the app on a NAS via a bare git repository.
Quick setup (example):
- On the NAS, create directories and a bare repo:
mkdir -p /srv/njts-accounting/repo.git
git init --bare /srv/njts-accounting/repo.git
mkdir -p /srv/njts-accounting/app
- Copy the
post-receivehook into the bare repo hooks and make it executable:
cp deploy/post-receive /srv/njts-accounting/repo.git/hooks/post-receive
chmod +x /srv/njts-accounting/repo.git/hooks/post-receive
- On your local machine, add a remote and push:
git remote add nas ssh://user@nas:/srv/njts-accounting/repo.git
git push nas main
- Ensure Docker and Docker Compose are installed on the NAS and
/srv/njts-accounting/docker-compose.ymlpoints to the code in/srv/njts-accounting/app.
Notes:
- Adjust paths and permissions according to your NAS environment.
- The sample hook runs
docker compose up -d --buildand may require the user to be in thedockergroup or run via sudo.