Moved repositories and databases to local directory

This commit is contained in:
2026-08-28 11:58:12 +03:00
parent 87eb38ad81
commit 61b322332f
4 changed files with 105 additions and 0 deletions
+20
View File
@@ -15,6 +15,26 @@ docker compose up -d
4. Open [http://localhost:3000](http://localhost:3000).
5. Create the first account. The first account becomes an administrator.
The `init-permissions` service runs once at startup to prepare the `docker/` data directories for Gitea and PostgreSQL. It will also correct ownership after restoring data from a backup.
## Migrate Existing Data
If you updated from the previous setup that used Docker named volumes, migrate your existing repositories and database before starting the updated stack:
```sh
sh ./migrate-to-bind-mounts.sh
docker compose up -d
```
This works on Linux, TrueNAS, and macOS because it uses POSIX shell and Docker. The script discovers the old Gitea and PostgreSQL volumes from their Docker Compose labels, stops the stack, then copies them into `docker/gitea` and `docker/postgres`. It refuses to overwrite non-empty destination directories. On Windows, run it from WSL or Git Bash.
If multiple old stacks exist on the same Docker host, identify the correct volume names with `docker volume ls`, then set `LEGACY_GITEA_VOLUME` and `LEGACY_POSTGRES_VOLUME` before running the migration:
```dotenv
LEGACY_GITEA_VOLUME=your-project_gitea_data
LEGACY_POSTGRES_VOLUME=your-project_postgres_data
```
The Git SSH endpoint is available on port `2222`:
```powershell