Added Docker Support

This commit is contained in:
2026-04-08 13:24:25 +01:00
parent af07ca1174
commit bea99b868c
5 changed files with 97 additions and 0 deletions

View File

@@ -27,10 +27,28 @@ npm run dev:server
The server listens on `http://localhost:8787` by default.
## Run With Docker
Use Docker Compose from the repository root:
```bash
docker compose up --build sync-server
```
Or build the image directly:
```bash
docker build -f apps/sync-server/Dockerfile -t obsidian-sync-server .
docker run --rm -p 8787:8787 -v obsidian-sync-data:/app/data obsidian-sync-server
```
The compose setup binds port `8787` by default and stores durable state in a named Docker volume called `obsidian-sync-data`.
## Environment Variables
- `PORT`: overrides the default HTTP port.
- `SYNC_DATA_DIR`: overrides the default data directory. If omitted, the server writes data under `./data` from the workspace root.
- `OBSIDIAN_SYNC_PORT`: optional compose override for the host port published by `compose.yaml`.
## Data Written By The Server
@@ -50,3 +68,4 @@ The server listens on `http://localhost:8787` by default.
- Request logs include a response header named `x-request-id` for correlating client and server failures.
- The current storage backend is file-based. It is durable for a single-node deployment but not yet designed for clustered or high-availability hosting.
- The plugin updates local sync state after each accepted push batch and each applied pull page, which lets interrupted sync runs resume from the last durable checkpoint.
- The Docker image includes a health check against `/health` and stores runtime data in `/app/data`.