new page 安装
parent
9f47fda77b
commit
57bf3ffb8e
|
|
@ -0,0 +1,57 @@
|
|||
(以下安装方法适用于1.1.12以上版本)
|
||||
|
||||
### 本地安装
|
||||
|
||||
1. 安装 [Golang](https://golang.org/)
|
||||
2. 安装 [beancount](./beancount-介绍)
|
||||
3. 克隆本项目或者下载Zip压缩包
|
||||
4. 根目录执行 go build 打包
|
||||
5. 执行服务,访问 http://localhost:10000
|
||||
|
||||
### Docker
|
||||
|
||||
```bash
|
||||
docker run --name beancount-gs -dp 10000:80 \
|
||||
-w /app \
|
||||
-v "/data/beancount:/data/beancount" \
|
||||
-v "/data/beancount/icons:/app/public/icons" \
|
||||
-v "/data/beancount/config:/app/config" \
|
||||
-v "/data/beancount/logs:/app/logs" \
|
||||
xdbin/beancount-gs:latest \
|
||||
sh -c "cp -rn /app/public/default_icons/* /app/public/icons && ./beancount-gs -p 80"
|
||||
```
|
||||
## Docker Compose
|
||||
|
||||
你也可以使用 docker-compose 启动镜像,创建 docker-compose.yml 文件(将下面的内容拷贝进文件)
|
||||
|
||||
```yaml
|
||||
version: "3.9"
|
||||
services:
|
||||
app:
|
||||
container_name: beancount-gs
|
||||
image: xdbin/beancount-gs:${tag:-latest}
|
||||
ports:
|
||||
- "10000:80"
|
||||
# volumes 挂载目录会导 /app/public/icons 中的图标被覆盖,这里将默认图标在挂载后重新拷贝图标
|
||||
command: >
|
||||
sh -c "cp -rn /app/public/default_icons/* /app/public/icons && ./beancount-gs -p 80"
|
||||
volumes:
|
||||
- "${dataPath:-/data/beancount}:/data/beancount"
|
||||
- "${dataPath:-/data/beancount}/icons:/app/public/icons"
|
||||
- "${dataPath:-/data/beancount}/config:/app/config"
|
||||
- "${dataPath:-/data/beancount}/bak:/app/bak"
|
||||
- "${dataPath:-/data/beancount}/logs:/app/logs"
|
||||
```
|
||||
|
||||
执行 `docker-compose up -d`
|
||||
|
||||
**自定义参数变量**
|
||||
|
||||
默认的文件存储路径为 /data/beancount,如果你想更换其他路径,可以在当前目录下新建 var.env,然后将下面内容复制到这个文件,tag 可以指定镜像版本,dataPath 指定文件存储路径
|
||||
|
||||
```
|
||||
tag=latest
|
||||
dataPath=自定义的目录
|
||||
```
|
||||
|
||||
执行 `docker-compose --env-file ./var.env up -d`
|
||||
Loading…
Reference in New Issue