From fdf42193ebb76e0e440a86020f705d76c2d25a5e Mon Sep 17 00:00:00 2001 From: filesite Date: Fri, 4 Nov 2022 11:59:42 +0800 Subject: [PATCH] docker-entrypoint.sh update --- .gitignore | 4 ++ Dockerfile | 6 +-- conf/custom_config_googleimage.json | 1 + conf/custom_config_manual.json | 1 + conf/custom_config_videoblog.json | 1 + conf/custom_config_webdirectory.json | 1 + conf/template_googleimage.php | 63 --------------------------- conf/template_manual.php | 65 ---------------------------- conf/template_videoblog.php | 63 --------------------------- conf/template_webdirectory.php | 57 ------------------------ docker-entrypoint.sh | 6 +-- docker_build.sh | 7 ++- 12 files changed, 18 insertions(+), 257 deletions(-) create mode 100644 conf/custom_config_googleimage.json create mode 100644 conf/custom_config_manual.json create mode 100644 conf/custom_config_videoblog.json create mode 100644 conf/custom_config_webdirectory.json delete mode 100644 conf/template_googleimage.php delete mode 100644 conf/template_manual.php delete mode 100644 conf/template_videoblog.php delete mode 100644 conf/template_webdirectory.php diff --git a/.gitignore b/.gitignore index 8412432..90ce5dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ .DS_Store test/content/ +runtime/ +www/navs/ +www/girls/ +www/videos/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index fe8ee7c..050430f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,8 +16,4 @@ RUN apk add \ EXPOSE 80/tcp ENTRYPOINT ["/var/www/machete/docker-entrypoint.sh"] # 默认使用导航站皮肤:manual -CMD ["manual"] - - -# build command -# docker build --no-cache -t filesite/machete . +CMD ["manual"] \ No newline at end of file diff --git a/conf/custom_config_googleimage.json b/conf/custom_config_googleimage.json new file mode 100644 index 0000000..dc571c8 --- /dev/null +++ b/conf/custom_config_googleimage.json @@ -0,0 +1 @@ +{"theme":"googleimage","content_directory":"girls"} \ No newline at end of file diff --git a/conf/custom_config_manual.json b/conf/custom_config_manual.json new file mode 100644 index 0000000..8ce928b --- /dev/null +++ b/conf/custom_config_manual.json @@ -0,0 +1 @@ +{"theme":"manual","content_directory":"content"} \ No newline at end of file diff --git a/conf/custom_config_videoblog.json b/conf/custom_config_videoblog.json new file mode 100644 index 0000000..9607ee0 --- /dev/null +++ b/conf/custom_config_videoblog.json @@ -0,0 +1 @@ +{"theme":"videoblog","content_directory":"videos"} \ No newline at end of file diff --git a/conf/custom_config_webdirectory.json b/conf/custom_config_webdirectory.json new file mode 100644 index 0000000..cdf9dd4 --- /dev/null +++ b/conf/custom_config_webdirectory.json @@ -0,0 +1 @@ +{"theme":"webdirectory","content_directory":"navs"} \ No newline at end of file diff --git a/conf/template_googleimage.php b/conf/template_googleimage.php deleted file mode 100644 index 10a2dba..0000000 --- a/conf/template_googleimage.php +++ /dev/null @@ -1,63 +0,0 @@ - 'Asia/Shanghai', //timezone - - //图片站皮肤 - 'content_directory' => 'girls/', //directory of contents in /www/ - 'theme' => 'googleimage', //name of theme which is enabled - - 'maxScanDirLevels' => 4, //max directory levels to scan - 'default_layout' => 'main', //default layout - 'error_layout' => 'error', //exception layout, show error title and content - - //for debug, log directory: ../runtime/logs/ - 'debug' => true, - - //图片皮肤配置 - 'googleimage' => array( - 'imageHeight' => 350, //图片高度,单位:px - 'contact' => 'FileSite图片网站订制联系:FileSite.io', - ), - - //目前支持的皮肤 - 'allowedThemes' => array( - 'manual', - 'webdirectory', - 'googleimage', - 'videoblog', - ), - - //md5加密前缀 - 'md5Prefix' => 'some_code_here', - - //后台管理相关配置 - 'admin' => array( - 'username' => 'filesite', - 'password' => '88888888', - 'captcha' => true, //后台登陆是否开启验证码 - - 'maxUploadFileSize' => 20, //单位:Mb - 'allowedUploadFileTypes' => array( - 'image/jpeg', - 'image/png', - 'image/webp', - 'image/gif', - ), - ), - -); - -//自定义配置支持 -$customConfigFile = __DIR__ . '/../runtime/custom_config.json'; -if (file_exists($customConfigFile)) { - try { - $json = file_get_contents($customConfigFile); - $customConfigs = json_decode($json, true); - $configs = array_merge($configs, $customConfigs); - }catch(Exception $e) {} -} - -return $configs; diff --git a/conf/template_manual.php b/conf/template_manual.php deleted file mode 100644 index 0d00e3a..0000000 --- a/conf/template_manual.php +++ /dev/null @@ -1,65 +0,0 @@ - 'Asia/Shanghai', //timezone - - //文档站皮肤 - 'content_directory' => 'content/', //directory of contents in /www/ - //when it's empty, use layout and views in directory views/ - 'theme' => 'manual', //name of theme which is enabled - - - 'maxScanDirLevels' => 4, //max directory levels to scan - 'default_layout' => 'main', //default layout - 'error_layout' => 'error', //exception layout, show error title and content - - //for debug, log directory: ../runtime/logs/ - 'debug' => true, - - //视频皮肤配置 - 'videoblog' => array( - 'imageHeight' => 180, //图片高度,单位:px - 'contact' => 'FileSite视频网站订制联系:FileSite.io', - ), - - //目前支持的皮肤 - 'allowedThemes' => array( - 'manual', - 'webdirectory', - 'googleimage', - 'videoblog', - ), - - //md5加密前缀 - 'md5Prefix' => 'some_code_here', - - //后台管理相关配置 - 'admin' => array( - 'username' => 'filesite', - 'password' => '88888888', - 'captcha' => true, //后台登陆是否开启验证码 - - 'maxUploadFileSize' => 20, //单位:Mb - 'allowedUploadFileTypes' => array( - 'image/jpeg', - 'image/png', - 'image/webp', - 'image/gif', - ), - ), - -); - -//自定义配置支持 -$customConfigFile = __DIR__ . '/../runtime/custom_config.json'; -if (file_exists($customConfigFile)) { - try { - $json = file_get_contents($customConfigFile); - $customConfigs = json_decode($json, true); - $configs = array_merge($configs, $customConfigs); - }catch(Exception $e) {} -} - -return $configs; diff --git a/conf/template_videoblog.php b/conf/template_videoblog.php deleted file mode 100644 index b1b9a64..0000000 --- a/conf/template_videoblog.php +++ /dev/null @@ -1,63 +0,0 @@ - 'Asia/Shanghai', //timezone - - //视频站皮肤 - 'content_directory' => 'videos/', //directory of contents in /www/ - 'theme' => 'videoblog', //name of theme which is enabled - - 'maxScanDirLevels' => 4, //max directory levels to scan - 'default_layout' => 'main', //default layout - 'error_layout' => 'error', //exception layout, show error title and content - - //for debug, log directory: ../runtime/logs/ - 'debug' => true, - - //视频皮肤配置 - 'videoblog' => array( - 'imageHeight' => 180, //图片高度,单位:px - 'contact' => 'FileSite视频网站订制联系:FileSite.io', - ), - - //目前支持的皮肤 - 'allowedThemes' => array( - 'manual', - 'webdirectory', - 'googleimage', - 'videoblog', - ), - - //md5加密前缀 - 'md5Prefix' => 'some_code_here', - - //后台管理相关配置 - 'admin' => array( - 'username' => 'filesite', - 'password' => '88888888', - 'captcha' => true, //后台登陆是否开启验证码 - - 'maxUploadFileSize' => 20, //单位:Mb - 'allowedUploadFileTypes' => array( - 'image/jpeg', - 'image/png', - 'image/webp', - 'image/gif', - ), - ), - -); - -//自定义配置支持 -$customConfigFile = __DIR__ . '/../runtime/custom_config.json'; -if (file_exists($customConfigFile)) { - try { - $json = file_get_contents($customConfigFile); - $customConfigs = json_decode($json, true); - $configs = array_merge($configs, $customConfigs); - }catch(Exception $e) {} -} - -return $configs; diff --git a/conf/template_webdirectory.php b/conf/template_webdirectory.php deleted file mode 100644 index 359eeb6..0000000 --- a/conf/template_webdirectory.php +++ /dev/null @@ -1,57 +0,0 @@ - 'Asia/Shanghai', //timezone - - //导航站皮肤 - 'content_directory' => 'navs/', //directory of contents in /www/ - 'theme' => 'webdirectory', - - 'maxScanDirLevels' => 4, //max directory levels to scan - 'default_layout' => 'main', //default layout - 'error_layout' => 'error', //exception layout, show error title and content - - //for debug, log directory: ../runtime/logs/ - 'debug' => true, - - //目前支持的皮肤 - 'allowedThemes' => array( - 'manual', - 'webdirectory', - 'googleimage', - 'videoblog', - ), - - //md5加密前缀 - 'md5Prefix' => 'some_code_here', - - //后台管理相关配置 - 'admin' => array( - 'username' => 'filesite', - 'password' => '88888888', - 'captcha' => true, //后台登陆是否开启验证码 - - 'maxUploadFileSize' => 20, //单位:Mb - 'allowedUploadFileTypes' => array( - 'image/jpeg', - 'image/png', - 'image/webp', - 'image/gif', - ), - ), - -); - -//自定义配置支持 -$customConfigFile = __DIR__ . '/../runtime/custom_config.json'; -if (file_exists($customConfigFile)) { - try { - $json = file_get_contents($customConfigFile); - $customConfigs = json_decode($json, true); - $configs = array_merge($configs, $customConfigs); - }catch(Exception $e) {} -} - -return $configs; diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 5e7e893..c037343 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -7,9 +7,9 @@ fi echo "Theme chosed [${theme}]." ## 复制对应皮肤的配置文件 -cd /var/www/machete/conf/ -rm -f app.php -cp "template_${theme}.php" app.php +cd /var/www/machete/runtime/ +rm -f custom_config.json +cp "../conf/custom_config_${theme}.json" ./ ## 启动nginx和php-fpm diff --git a/docker_build.sh b/docker_build.sh index bf375b7..2715d4a 100755 --- a/docker_build.sh +++ b/docker_build.sh @@ -2,4 +2,9 @@ docker stop machete docker rm machete docker rmi filesite/machete -docker build --no-cache -t filesite/machete . + +## build filesite/machete:latest +docker build --no-cache -t filesite/machete -f ./Dockerfile . + +## build filesite/machete:samba +docker build --no-cache -t filesite/machete:samba -f ./Dockerfile_samba . \ No newline at end of file