运行Dashy的最简单的方法是使用Docker,使用下面的命令即可安装启动了:
docker run -d \
-p 8080:80 \
-v ~/my-conf.yml:/app/public/conf.yml \
--name my-dashboard \
--restart=always \
lissy93/dashy:latest
如果你喜欢使用 docker-compose,也可以使用下面的 yaml 来启动:
---
version: "3.8"
services:
dashy:
# To build from source, replace 'image: lissy93/dashy' with 'build: .'
# build: .
image: lissy93/dashy
container_name: Dashy
# Pass in your config file below, by specifying the path on your host machine
# volumes:
# - /root/my-config.yml:/app/public/conf.yml
ports:
- 4000:80
# Set any environmental variables
environment:
- NODE_ENV=production
# Specify your user ID and group ID. You can find this by running `id -u` and `id -g`
# - UID=1000
# - GID=1000
# Specify restart policy
restart: unless-stopped
# Configure healthchecks
healthcheck:
test: ['CMD', 'node', '/app/services/healthcheck']
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
Dashy的配置使用YAML文件,保存在 /public/conf.yml 中,配置文件格式非常简单,有3个主要的属性:
如下所示:
pageInfo:
title: Home Lab
sections: # An array of sections
- name: Example Section
icon: far fa-rocket
items:
- title: GitHub
description: Dashy source code and docs
icon: fab fa-github
url: https://github.com/Lissy93/dashy
- title: Issues
description: View open issues, or raise a new one
icon: fas fa-bug
url: https://github.com/Lissy93/dashy/issues
- name: Local Services
items:
- title: Firewall
icon: favicon
url: http://192.168.1.1/
- title: Game Server
icon: https://i.ibb.co/710B3Yc/space-invader-x256.png
url: http://192.168.130.1/
可以使用 Docker volume将配置文件从主机系统挂载到容器中去,例如 -v ./host-system/my-local-conf.yml:/app/public/conf.yml,也可以直接通过 UI 编辑你的配置,更改将保存在此文件中。使用 docker exec -it [container-id] yarn validate-config 命令检查你的配置。编辑配置后,应用程序将在后台重建,这可能需要一分钟。
可以直接查看官方示例 https://demo.dashy.to/、https://live.dashy.to/ 了解更多信息。
(责任编辑:探索)
航天科技集团研制大气环境监测卫星大气一号上线 高精度监测能力提升
使用电脑,桌面右下角图标不显示怎么办?电脑图标不显示解决方法