This commit is contained in:
admin
2026-01-22 21:05:48 +09:00
parent 3d91356877
commit 536266d70b
11 changed files with 236 additions and 85 deletions

34
deploy/README.md Normal file
View File

@@ -0,0 +1,34 @@
# 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:
```bash
mkdir -p /srv/njts-accounting/repo.git
git init --bare /srv/njts-accounting/repo.git
mkdir -p /srv/njts-accounting/app
```
2. Copy the `post-receive` hook into the bare repo hooks and make it executable:
```bash
cp deploy/post-receive /srv/njts-accounting/repo.git/hooks/post-receive
chmod +x /srv/njts-accounting/repo.git/hooks/post-receive
```
3. On your local machine, add a remote and push:
```bash
git remote add nas ssh://user@nas:/srv/njts-accounting/repo.git
git push nas main
```
4. 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.