Add production Docker deployment
Amp-Thread-ID: https://ampcode.com/threads/T-01a02485-5574-707c-bff4-5668d83bee8a Co-authored-by: Heaust Azure <heaust.azure@gmail.com>
This commit is contained in:
@@ -25,6 +25,22 @@ as a separate module dependency instead of bundling it. Map and import both URLs
|
||||
`/playground/{id}/{revision}` URLs. Set `PORT` or `YAWN_DATABASE` to override the default port and
|
||||
`server/data/yawn.db` database path.
|
||||
|
||||
## VPS deployment
|
||||
|
||||
Clone the repository to `~/yawn` on a VPS with Docker and the Compose plugin, then run:
|
||||
|
||||
```sh
|
||||
cd ~/yawn
|
||||
./server/deploy-docker.sh
|
||||
```
|
||||
|
||||
The deploy script requires a clean `main`, fast-forwards it to `origin/main`, builds the production
|
||||
image, starts it with Docker Compose, and waits for the health check. Core, Handles, workers, and
|
||||
WASM are compiled while building the image; the runtime container only holds the Go server,
|
||||
prebuilt package assets, Monaco, and the persistent SQLite volume. Configure the port and database
|
||||
path in `compose.yaml`. The default port binding is private to the VPS at `127.0.0.1:5002`; put
|
||||
Caddy or nginx in front of it for HTTPS. Follow logs with `docker compose logs -f yawn`.
|
||||
|
||||
Run the previous VitePress documentation site with `npm start`.
|
||||
|
||||
Run `npm run coredocs` for the raw worker-message, shared-memory, and render-graph reference intended for custom handles, editors, and direct SAB clients.
|
||||
|
||||
Reference in New Issue
Block a user