docker部署zdir:一个美观、实用的目录列表程序

效果:

项目地址: https://github.com/helloxz/zdir

使用方法:

  • 下载源码放到站点根目录
  • config.simple.php修改为config.php
  • 修改config.php设置自己的网站标题/关键词/描述
  • 如果需要排除某个目录,再次修改config.php ,里面有说明
  • 更多说明请查看帮助文档:https://doc.xiaoz.me/#/zdir/

下面docker部署已知缺陷:

上传有点问题。方案一是由于权限问题,nginx和php是nobody用户运行的

docker部署方案一:

使用zdir的代码部署,我还没研究代码,代码中会有一些广告,可以手动删除

[root@glowing-bliss-1 tmp]# git clone https://github.com/helloxz/zdir.git
[root@glowing-bliss-1 ~]# cd /tmp/tmp/zdir/
[root@glowing-bliss-1 zdir]# cp config.simple.php config.php 
[root@glowing-bliss-1 zdir]# vim config.php #管理密码在此文件,可以修改
[root@glowing-bliss-1 tmp]# docker run -p 8080:8080 -v /tmp/tmp/zdir:/var/www/html trafex/alpine-nginx-php7

docker部署方案二:

这个别人弄好的镜像,去掉了广告,但是删减太多了,导致也上传不了文件,所以用了kodexplorer

docker run -d -p 8080:80 -v /var/zdir:/var/www/html/var baiyuetribe/zdir
docker run -d -p 899:80 --name kodexplorer -v /var/zdir:/var/www/html/zdir yangxuan8282/kodexplorer

只是玩玩,我估计没人用docker容器做文件存储吧

最后找了两个小点的nginx+php的镜像

# https://gitlab.com/ric_harvey/nginx-php-fpm
richarvey/nginx-php-fpm
# https://github.com/TrafeX/docker-php-nginx
trafex/alpine-nginx-php7