Files
RawMark/README.md
T
eezd bfe0a0654d build: add Docker image and deployment notes
- Multi-stage build: frontend, static Go binary with embedded assets,
  distroless nonroot runtime (~35 MB) with a built-in healthcheck
- Explain how to fix data directory permission errors on bind mounts
2026-10-16 18:37:14 +08:00

37 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# RawMark
纯 Markdown 笔记网页编辑器:所见即所得(类 Obsidian Live Preview)、文件即真源、Docker 部署、浏览器访问。
## 部署
```sh
mkdir -p ~/rawmark-data
docker build -t rawmark .
docker run -d --name rawmark \
--user "$(id -u):$(id -g)" \
-p 8080:8080 \
-v ~/rawmark-data:/data \
--restart unless-stopped \
rawmark
```
- 首次打开需要输入启动码,位于数据目录的 `setup-code.txt`(如 `~/rawmark-data/setup-code.txt`),设置密码后自动删除。
- 笔记以普通 `.md` 文件保存在 `数据目录/vault/`,图片按 Typora 习惯存放在同级的 `笔记名.assets/`,可直接用 Typora 等编辑器打开;外部修改会实时同步到网页。
- `--user` 让容器以宿主机用户身份读写数据目录;不指定时容器以 UID 65532 运行,需要该用户对目录有写权限。
- 请通过 HTTPS 反向代理(Caddy、Nginx 等)访问,并转发 WebSocket(`/api/v1/events`)。笔记加密等功能依赖浏览器的安全上下文,纯 HTTP 下不可用。
| 环境变量 | 默认值 | 说明 |
| --- | --- | --- |
| `RAWMARK_DATA` | `/data` | 数据目录(数据库、默认笔记仓库) |
| `RAWMARK_VAULT` | `$RAWMARK_DATA/vault` | 笔记仓库目录,可指向已有的笔记文件夹 |
| `RAWMARK_ADDR` | `:8080` | 监听地址 |
## 开发
```sh
cd web && npm install
npm run dev # 前端开发服务器,/api 转发到 127.0.0.1:8080
npm run typecheck && npm test
go test ./internal/...
```