{"id":18244075,"url":"https://github.com/jjling2011/typecho-mini","last_synced_at":"2026-04-16T13:31:44.582Z","repository":{"id":171886549,"uuid":"601572078","full_name":"jjling2011/typecho-mini","owner":"jjling2011","description":"typecho的迷你容器（只有30M）mini docker for typecho","archived":false,"fork":false,"pushed_at":"2025-03-28T01:23:12.000Z","size":560,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T02:28:53.357Z","etag":null,"topics":["docker","mini","nginx","php","php-fpm","typecho"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jjling2011.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-14T10:59:26.000Z","updated_at":"2025-03-28T01:23:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"6bbcc086-99bb-4dda-b30f-0d8f8d9a63a8","html_url":"https://github.com/jjling2011/typecho-mini","commit_stats":null,"previous_names":["jjling2011/typecho-mini"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjling2011%2Ftypecho-mini","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjling2011%2Ftypecho-mini/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjling2011%2Ftypecho-mini/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjling2011%2Ftypecho-mini/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jjling2011","download_url":"https://codeload.github.com/jjling2011/typecho-mini/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247901695,"owners_count":21015317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","mini","nginx","php","php-fpm","typecho"],"created_at":"2024-11-05T09:15:23.546Z","updated_at":"2026-04-16T13:31:39.550Z","avatar_url":"https://github.com/jjling2011.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typecho-mini\ntypecho的迷你容器（只有30M） mini docker for typecho  \n\n在Alpine v3.15.6的基础上安装了nginx和php8-fpm。其中php只安装了typecho必须的插件。容器内部以nobody身份运行，提高安全性。  \nhttps://www.my-website.com/typecho/ 是typecho博客  \nhttps://www.my-website.com/media/ 是webdav协议挂载目录  \n\n#### 构建image\n```bash\ndocker build . -t typecho-mini\n```\n\n#### 运行container\n```bash\ndocker run --cap-drop ALL -it -p 443:443 --name typecho-mini typecho-mini\n\n--cap-drop ALL # 禁止所有特殊权限\n-p 443:443     # 如果本机443端口已经被占用可以改成其他端口,比如： 2443:443\n-it            # 以交互方式运行方便debug。按ctrl+p, ctrl+q退出交互模式\n```\n添加`--restart always`参数可实现开机启动（当然docker服务也要处于开机启动状态才行）。  \n\n#### 安装配置typecho\n在浏览器打开[https://localhost:443/typecho/](https://localhost:443/typecho/)，按提示创建账号、密码。  \n\n#### 挂载数据卷\n由于数据存放在docker内部，通过挂载数据卷可以方便的备份、还原数据。\n```bash\n# 创建一个数据卷\ndocker volume create typecho-volume\n\n# 查看数据卷的位置（注意Mountpoint行）\ndocker volume inspect typecho-volume\n\n# 将当前运行中的容器urs目录复制到数据卷中\ndocker cp typecho-mini:/var/www/html/ /path/to/typecho-volume/_data/\n\n# 停止并删除当前容器\ndocker stop typecho-mini\ndocker rm typecho-mini\n\n# 重新运行容器\ndocker run --cap-drop ALL -it -p 443:443 \\\n    -v typecho-volume:/var/www/html \\\n    --name typecho-mini typecho-mini\n```\n备份的时候直接对_data目录进行tar即可。还原同理。  \n\n#### 挂载媒体数据到webdav目录\n```bash\n# 在数据卷内创建docker符号链接\ncd /path/to/typecho-volume/_data/\nmkdir media \u0026\u0026 cd media\nln -s /mnt/music\nln -s /mnt/movie\n\n# 创建访问密码\nhtpasswd -c .htpasswd \u003c任意用户名\u003e\n\n# 把主机媒体数据的目录挂载到docker的/mnt目录\ndocker run --cap-drop ALL -it -p 443:443 \\\n    -v typecho-volume:/var/www/html \\\n    -v /path/to/music:/mnt/music/ \\\n    -v /path/to/movie:/mnt/movie/ \\\n    --name typecho-mini typecho-mini\n```\n\n#### 替换ssl证书\n这个docker镜像在构建时会创建一个随机的自签名证书，如果你想用自己的证书，可以把.key和.crt文件复制到`rootfs/etc/nginx/conf.d`中，然后重新构建、启动容器。  \n```bash\ncp /path/to/your/ssl.key rootfs/etc/nginx/conf.d/server.key\ncp /path/to/your/ssl.crt rootfs/etc/nginx/conf.d/server.crt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjling2011%2Ftypecho-mini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjling2011%2Ftypecho-mini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjling2011%2Ftypecho-mini/lists"}