前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >群晖Docker安装chevereto图床

群晖Docker安装chevereto图床

作者头像
IT小马哥
发布2020-06-16 10:33:21
4.5K2
发布2020-06-16 10:33:21
举报
文章被收录于专栏:Java TaleJava Tale

Docker chevereto 准备的环境

mysql 数据库 (我目前是使用的是MariaDB 10,安装数据库不多做叙述,可以看我之前的教程)

我用的是 Navicat ,新建数据库 填写 chevereto 如图:

http://maruifu.cn/upload/2020/06/chevereto6.png
http://maruifu.cn/upload/2020/06/chevereto6.png

Docker chevereto的下载

在群晖docker里面的注册表里面搜索 Chevereto ,我用的nmtan/chevereto下载,如果有让你选择标签的话默认就好,等待容器镜像下载完成。如图:

http://maruifu.cn/upload/2020/06/chevereto1.png
http://maruifu.cn/upload/2020/06/chevereto1.png

Docker chevereto的存储卷

在群晖的docker目录里面建立子目录Chevereto,后面安装容器会挂载此目录作为图床的文件存储目录,注意文件名的大小写

http://maruifu.cn/upload/2020/06/chevereto2.png
http://maruifu.cn/upload/2020/06/chevereto2.png

Docker chevereto的配置

容器镜像下载完成后,点击下载的镜像文件名的小箭头,查看该容器该如何进行配置,docker其实大部分都有配置介绍,多看看自己也会配置

http://maruifu.cn/upload/2020/06/chevereto3.png
http://maruifu.cn/upload/2020/06/chevereto3.png
http://maruifu.cn/upload/2020/06/chevereto4.png
http://maruifu.cn/upload/2020/06/chevereto4.png

双击该镜像进行安装,容器名称随意填写,内存限制根据实际需要填写,点击高级设置,启用自动重新启动打钩,卷设置里面点击添加文件夹,选择你刚刚在docker目录下创建的 chevereto目录,后面装载路径填写【/var/www/html/images】,不能有空格,请注意,然后在到端口设置,本地端口设置为10000,容器端口不需要修改,后面进行docker的环境配置,

http://maruifu.cn/upload/2020/06/chevereto5.png
http://maruifu.cn/upload/2020/06/chevereto5.png

点击启用后,可以使用http:群晖地址:10000 进行访问,设置 相关的信息

有时候会提示群晖 没有 对 images 文件夹的写入权限 ,后面对/volume1/docker/chevereto 赋予权限即可!

也可以从ssh 里面直接赋予所有权限

代码语言:javascript
复制
chmod +r 777 chevereto

Docker chevereto修改上传大小

http://域名:10000/dashboard/settings/image-upload

获取root权限

代码语言:javascript
复制
admin@XiaoMageNAS:~$ sudo -i
root@XiaoMageNAS:~# 

查看运行的docker容器

代码语言:javascript
复制
root@XiaoMageNAS:~# docker ps -a
CONTAINER ID        IMAGE                              COMMAND                  CREATED             STATUS                     PORTS                                             NAMES
327c9776e0d3        nmtan/chevereto:latest             "docker-php-entrypoi…"   17 hours ago        Up 5 hours                 0.0.0.0:10000->80/tcp                             Chevereto
7a30c3437280        oldiy/music-player-docker:latest   "docker-php-entrypoi…"   13 days ago         Up 13 days                 0.0.0.0:32769->264/tcp, 0.0.0.0:32768->9000/tcp   oldiy-music-player-docker1
1c8b79caaee6        luodaoyi/kms-server:1112           "/bin/sh -c 'vlmcsdm…"   8 weeks ago         Exited (255) 7 weeks ago                                                     luodaoyi-kms-server1
root@XiaoMageNAS:~# 

复制到群晖本地目录

代码语言:javascript
复制
root@XiaoMageNAS:~# docker cp  327c9776e0d3:/var/www/html/.htaccess /volume1/docker/
root@XiaoMageNAS:~# 

修改配置文件

代码语言:javascript
复制
vi /volume1/docker/.htaccess
代码语言:javascript
复制
# Disable server signature
ServerSignature Off



# Disable directory listing (-indexes), Multiviews (-MultiViews) and enable Follow system links (+FollowSymLinks)
Options -Indexes
Options -MultiViews

<IfModule mod_rewrite.c>

    RewriteEngine On

    # If you have problems with the rewrite rules remove the "#" from the following RewriteBase line
    # You will also have to change the path to reflect the path to your Chevereto installation
    # If you are using alias is most likely that you will need this.
    #RewriteBase /

    # 404 images
    # If you want to have your own fancy "image not found" image remove the "#" from RewriteCond and RewriteRule lines
    # Make sure to apply the correct paths to reflect your current installation
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule images/.+\.(gif|jpe?g|png|bmp) - [NC,L,R=404]
    #RewriteRule images/.+\.(gif|jpe?g|png|bmp) content/images/system/default/404.gif [NC,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !\.(css|js|html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpe?g|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ [NC]
    RewriteRule . index.php [L]
    #修改上传文件大小增加以下 配置  最大支持 32M 根据自己情况配置
    php_value post_max_size 64M
    php_value upload_max_filesize 32M

</IfModule>

复制到容器目录里面

代码语言:javascript
复制
docker cp /volume1/docker/.htaccess 327c9776e0d3:/var/www/html/

然后进入到docker容器管理里面重新启动即可解除2m上传限制

http://maruifu.cn/upload/2020/06/chevereto7.png
http://maruifu.cn/upload/2020/06/chevereto7.png

本文由 小马哥 创作

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-06-14,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Docker chevereto 准备的环境
  • Docker chevereto的下载
  • Docker chevereto的存储卷
  • Docker chevereto的配置
  • Docker chevereto修改上传大小
    • 获取root权限
      • 查看运行的docker容器
        • 复制到群晖本地目录
          • 修改配置文件
            • 复制到容器目录里面
            相关产品与服务
            容器服务
            腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
            领券
            问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档