chevereto图床搭建

群晖Docker安装chevereto图床

Docker chevereto准备的环境

mysql数据库(我目前是使用的是MariaDB 10,套件中心直接安装)

我用的是Navicat,新建数据库填写chevereto下面:

chevereto6.th.png

Docker chevereto的下载

在群晖docker里面的注册表里面搜索

chevereto1.th.png

Docker chevereto的存储卷

chevereto2.th.png

Docker chevereto的配置

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

chevereto3.th.png

chevereto4.th.png

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

chevereto5.th.png

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

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

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

1
chmod +r 777 chevereto

Docker chevereto修改上传大小

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

获取root权限

1
2
admin@DSM3617:~$ sudo -i
root@DSM3617:~#

查看运行的docker容器

1
2
3
4
5
6
7
root@DSM3617:/volume1/docker# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bc9701c6850c nmtan/chevereto:latest "docker-php-entrypoi…" 6 hours ago Up 29 minutes 0.0.0.0:10000->80/tcp nmtan-chevereto1
a906997c2ff6 synology/gitlab:11.11.8 "/sbin/entrypoint.sh…" 3 weeks ago Up 5 hours 443/tcp, 0.0.0.0:30001->22/tcp, 0.0.0.0:30000->80/tcp synology_gitlab
f6e478504c02 sameersbn/postgresql:10 "/sbin/entrypoint.sh" 3 weeks ago Up 5 hours 5432/tcp synology_gitlab_postgresql
1c6ced1ca7ad sameersbn/redis:4.0.9-1 "/sbin/entrypoint.sh" 3 weeks ago Up 5 hours 6379/tcp synology_gitlab_redis

复制到群晖本地目录

1
2
root@DSM3617:~# docker cp  bc9701c6850c:/var/www/html/.htaccess /volume1/docker/
root@DSM3617:~#

修改配置文件

1
vi /volume1/docker/.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 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>

复制到容器目录里面

1
docker cp /volume1/docker/.htaccess bc9701c6850c:/var/www/html/

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

chevereto7.png