本源归一

御龙工作室

Docker部署Umami统计小白流程

本源归一 2024年02月18日 编辑

之前看别人自己部署了Umami的站点,十分炫酷。于是今天十分有兴致的来试了一试。到处不懂,各种方法很混乱。说简单也简单,说难也挺难的。先是用Vercel部署的,但是用起来很卡,不是很舒服。于是又准备在自己的服务器上部署 。各种错误尝试了个遍。最后在大晚上,功夫不负有心人,成功在自己的小机子上部署成功了。

屋外正下着微微细雨,于是趁着这情景抓紧水一篇博文。

本方法演示的是宝塔安装的方法。

1.宝塔安装基础的运行环境,安装Docker,MySQL需要5.7版本以上。
Snipaste_2024-02-18_21-51-47.png
2.新建一个空战点
Snipaste_2024-02-18_21-53-30.png
清空站点目录在目录新建一个文件,命名为docker-compose.yml
Snipaste_2024-02-18_21-51-47.png
编辑文件,编辑下面的内容,填入上述文件并保存(这是采用服务器宝塔安装的MySQL)

version: '3'
services:
  umami:
    image: ghcr.io/umami-software/umami:mysql-latest
    restart: always
    network_mode: "host"
    environment:
    DATABASE_TYPE: mysql
    DATABASE_URL: mysql://数据库用户名:数据库 密码@localhost:3306/数据库名
    APP_SECRET: 更改此处为随机字符串
    container_name: umami

注:ghcr.io/umami-software/umami:mysql-latest下载很慢,可以使用我的阿里云镜像:registry.ap-southeast-1.aliyuncs.com/yulongba/umami:v2.0.9

3.完成以后,SSH链接成功,进入站点文件夹:cd /www/wwwroot/xxx.xxx.com

输入命令:docker compose up -d

4.搭建成功,访问http://yourip:3000/即可。可以自行在站点内反向代理。
Snipaste_2024-02-18_21-51-47.png

效果:点击查看


Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Warning: Attempt to read property "screenName" on array in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/ww-fs.com/usr/plugins/CustomRSS/Plugin.php on line 89