diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..f4d3b18 --- /dev/null +++ b/README.MD @@ -0,0 +1,5 @@ +# CaddyServer with PHP-FPM +# ======================== +# +# This is a simple Docker image to run CaddyServer with PHP-FPM. + diff --git a/config/Caddyfile b/examples/config/Caddyfile similarity index 100% rename from config/Caddyfile rename to examples/config/Caddyfile diff --git a/config/Dockerfile b/examples/config/Dockerfile similarity index 95% rename from config/Dockerfile rename to examples/config/Dockerfile index 46c1aec..b2e971b 100644 --- a/config/Dockerfile +++ b/examples/config/Dockerfile @@ -1,7 +1,7 @@ FROM caddy:alpine as caddy FROM php:8-fpm-alpine # 复制caddy相关文件 -COPY --from=caddy /config /config +COPY --from=caddy /examples/config /config COPY --from=caddy /data /data COPY --form=caddy /etc/caddy /etc/caddy COPY --from=caddy /usr/bin/caddy /usr/bin/caddy diff --git a/config/php-fpm.conf b/examples/config/php-fpm.conf similarity index 100% rename from config/php-fpm.conf rename to examples/config/php-fpm.conf diff --git a/config/www.conf b/examples/config/www.conf similarity index 89% rename from config/www.conf rename to examples/config/www.conf index e8885b3..d10797d 100644 --- a/config/www.conf +++ b/examples/config/www.conf @@ -1,7 +1,7 @@ [www] -user = www -group = www +user = www-data +group = www-data listen = 127.0.0.1:9000 diff --git a/examples/web/config/Caddyfile b/examples/web/config/Caddyfile new file mode 100644 index 0000000..effc101 --- /dev/null +++ b/examples/web/config/Caddyfile @@ -0,0 +1,13 @@ +:80 { + encode gzip + root * /www/websites/public + php_fastcgi php-fpm:9000 + file_server +} + +lsky.album.run:80 { + encode gzip + root * /www/websites/lsky/public + php_fastcgi php-fpm:9000 + file_server +} \ No newline at end of file diff --git a/typecho/docker-compose.yaml b/examples/web/docker-compose.yaml similarity index 86% rename from typecho/docker-compose.yaml rename to examples/web/docker-compose.yaml index 5b351fa..5903f18 100644 --- a/typecho/docker-compose.yaml +++ b/examples/web/docker-compose.yaml @@ -7,7 +7,7 @@ services: - "80:80" - "443:443" volumes: - - ./Caddyfile:/etc/caddy/Caddyfile + - ./config/Caddyfile:/etc/caddy/Caddyfile - ./config:/config - ./data:/data - ./websites:/www/websites @@ -19,7 +19,7 @@ services: php-cgi: container_name: php-fpm build: - context: . + context: ../../php-fpm/8.2 dockerfile: Dockerfile volumes: - ./websites:/www/websites diff --git a/examples/web/websites/public/index.php b/examples/web/websites/public/index.php new file mode 100644 index 0000000..bfd863b --- /dev/null +++ b/examples/web/websites/public/index.php @@ -0,0 +1,2 @@ +

本站由提供CDN加速服务";s:7:"Sidebar";N;s:15:"SidebarPosition";a:2:{i:0;s:12:"ExternalPage";i:1;s:12:"InternalPage";}s:11:"SidebarRorL";s:3:"R-L";s:20:"SidebarBackgroundImg";s:0:"";s:10:"SideAvatar";s:0:"";s:9:"Signature";s:0:"";s:6:"Smooth";a:1:{i:0;s:6:"Smooth";}s:4:"Pjax";a:1:{i:0;s:4:"Pjax";}s:7:"MathJax";N;s:12:"StaticCDNUrl";s:0:"";s:10:"CustomMenu";s:0:"";s:12:"MusicListUrl";s:62:"https://music.163.com/#/playlist?id=2740824585&userid=77929069";s:9:"MusicList";s:0:"";s:12:"CustomHeader";s:0:"";s:11:"CustomStyle";s:0:"";s:12:"CustomFooter";s:0:"";s:12:"PjaxCallback";s:0:"";s:11:"DNSPreParse";s:0:"";s:11:"CustomFonts";s:0:"";s:5:"Eruda";N;}'; - -$stt = 'a:50:{s:7:"TopPost";s:0:"";s:14:"IndexTopImgUrl";s:0:"";s:13:"IndexBigTitle";s:0:"";s:13:"IndexSubtitle";s:0:"";s:17:"IndexTopImgHeight";s:0:"";s:13:"PostImgCenter";N;s:7:"UpLikes";N;s:6:"Reward";N;s:6:"Alipay";s:0:"";s:9:"WeChatPay";s:0:"";s:5:"QQPay";s:0:"";s:9:"Copyright";N;s:22:"CopyrightConfiguration";N;s:13:"CopyrightText";s:0:"";s:7:"RandImg";s:0:"";s:18:"CodeHighLightStyle";N;s:12:"MourningMode";N;s:16:"HeaderTransition";N;s:10:"Pagination";N;s:8:"Headroom";N;s:10:"LabelOrder";N;s:10:"MergePages";s:0:"";s:3:"key";s:0:"";s:12:"SiteSubtitle";s:0:"";s:7:"Favicon";s:0:"";s:7:"LogoUrl";s:0:"";s:10:"GlobalFont";N;s:16:"GlobalCommentBan";N;s:3:"ICP";s:0:"";s:9:"Policemen";s:526:"贵公网安备52050202001317号

本站由提供CDN加速服务";s:7:"Sidebar";N;s:15:"SidebarPosition";N;s:11:"SidebarRorL";N;s:20:"SidebarBackgroundImg";s:0:"";s:10:"SideAvatar";s:0:"";s:9:"Signature";s:0:"";s:6:"Smooth";N;s:4:"Pjax";N;s:7:"MathJax";N;s:12:"StaticCDNUrl";s:0:"";s:10:"CustomMenu";s:0:"";s:12:"MusicListUrl";s:0:"";s:9:"MusicList";s:0:"";s:12:"CustomHeader";s:0:"";s:11:"CustomStyle";s:0:"";s:12:"CustomFooter";s:6:"内容";s:12:"PjaxCallback";s:0:"";s:11:"DNSPreParse";s:0:"";s:11:"CustomFonts";s:0:"";s:5:"Eruda";N;}'; -$unserialize = unserialize('a:1:{s:7:"UpLikes";a:1:{i:0;s:7:"UpLikes";}}'); -print_r($unserialize); - -$arr = [ - "TopPost" => "", - "IndexTopImgUrl" => "https://api.rainss.cn/random.php", - "IndexBigTitle" => "雨落凋殇", - "IndexSubtitle" => "聆听雨落的声音,俯看凋零的落叶.伫细雨之中,感雨落之殇", - "IndexTopImgHeight" => "", - "PostImgCenter" => null, - "UpLikes" => ["UpLikes"], - "Reward" => null, - "Alipay" => "", - "WeChatPay" => "", - "QQPay" => "", - "Copyright" => ["Copyright"], - "CopyrightConfiguration" => ["author","provenance"], - "CopyrightText" => "", - "RandImg" => "http://api.rainss.cn/random.php?rand=1 -https://resource.upcdn.rainss.cn/large/0072Vf1pgy1foxlogttvbj31hc0u0dyf.jpg -https://resource.upcdn.rainss.cn/large/0072Vf1pgy1foxloatthsj31kw0w07sn.jpg -https://resource.upcdn.rainss.cn/large/0072Vf1pgy1foxlo1tjbnj31hc0u0wwc.jpg -https://resource.upcdn.rainss.cn/large/0072Vf1pgy1foxlny0lgrj31kw0w0e2v.jpg -https://resource.upcdn.rainss.cn/large/0072Vf1pgy1foxlnr1pdmj31hc0u0h1c.jpg -https://resource.upcdn.rainss.cn/large/0072Vf1pgy1fodqmpz6zpj312z0svu0x.jpg -https://resource.upcdn.rainss.cn/large/0072Vf1pgy1foxk3pfp31j31hc0u0kas.jpg -https://resource.upcdn.rainss.cn/large/0072Vf1pgy1foxk3rxvthj31kw0w0x3c.jpg -https://resource.upcdn.rainss.cn/large/0072Vf1pgy1foxk7kp8m2j31hc0u07ji.jpg -https://resource.upcdn.rainss.cn/large/0072Vf1pgy1foxk7okxe5j31hc0u0nhp.jpg", - "CodeHighLightStyle" => "dark", - "MourningMode" => null, - "HeaderTransition" => "wave", - "Pagination" => "number", - "Headroom" => null, - "LabelOrder" => "C-P", - "MergePages" => "更多", - "key" => "123", - "SiteSubtitle" => "", - "Favicon" => "", - "LogoUrl" => "", - "GlobalFont" => null, - "GlobalCommentBan" => null, - "ICP" => "黔ICP备16009961号", - "Policemen" => "贵公网安备52050202001317号

\"\"

本站由\"\"提供CDN加速服务", - "Sidebar" => null, - "SidebarPosition" => ["ExternalPage","InternalPage"], - "SidebarRorL" => "R-L", - "SidebarBackgroundImg" => "", - "SideAvatar" => "", - "Signature" => "", - "Smooth" => ["Smooth"], - "Pjax" => ["Pjax"], - "MathJax" => null, - "StaticCDNUrl" => "", - "CustomMenu" => "", - "MusicListUrl" => "https://music.163.com/#/playlist?id=2740824585&userid=77929069", - "MusicList" => "", - "CustomHeader" => "", - "CustomStyle" => "", - "CustomFooter" => "", - "PjaxCallback" => "", - "DNSPreParse" => "", - "CustomFonts" => "", - "Eruda" => null -]; -echo serialize($arr); \ No newline at end of file