Files
2026-01-22 21:05:48 +09:00

1.0 KiB

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):

  1. 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
  1. Copy the post-receive hook 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
  1. 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
  1. Ensure Docker and Docker Compose are installed on the NAS and /srv/njts-accounting/docker-compose.yml points 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 --build and may require the user to be in the docker group or run via sudo.