{"id":20253416,"url":"https://github.com/fireinrain/typecho-docker","last_synced_at":"2026-05-04T18:33:11.017Z","repository":{"id":104613624,"uuid":"595772428","full_name":"fireinrain/typecho-docker","owner":"fireinrain","description":"A repo for building typecho docker image and docker-compose","archived":false,"fork":false,"pushed_at":"2023-02-01T08:23:02.000Z","size":559,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T16:50:55.676Z","etag":null,"topics":["blog","docker","docker-compose","typecho"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fireinrain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-01-31T19:26:49.000Z","updated_at":"2023-01-31T19:28:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"e2ad6863-b4d6-4cba-92f9-b1079de7b2e0","html_url":"https://github.com/fireinrain/typecho-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fireinrain/typecho-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fireinrain%2Ftypecho-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fireinrain%2Ftypecho-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fireinrain%2Ftypecho-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fireinrain%2Ftypecho-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fireinrain","download_url":"https://codeload.github.com/fireinrain/typecho-docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fireinrain%2Ftypecho-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32619638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["blog","docker","docker-compose","typecho"],"created_at":"2024-11-14T10:23:57.479Z","updated_at":"2026-05-04T18:33:10.999Z","avatar_url":"https://github.com/fireinrain.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typecho docker 镜像\n\n# 安装环境\n```bash\ntypecho 1.2\ndocker(mysql5.7,php7.4,nginx1.3)\n```\n\n# 使用指南\n```bash\n1. 在服务器自定义目录创建文件夹: `mkdir website`\n2. `cd website`\n3. `git clone https://github.com/fireinrain/typecho-docker`\n4. 修改mysql.env 中的值为自定义值(密码最好复杂一点), 修改docker-compose.yml nginx的ssl证书映射路径\n5. 启动容器`docker-compose -f docker-compose.yml up -d`\n6. 修改网站目录为可写状态 chmod -R 777 www\n7. 重新启动docker 容器 `docker-compose -f docker-compose.yml restart`\n6. 访问地址 https://你的域名/install.php，进入到初始化页面\n7. 按照初始化的指引，完成步骤，最后将生成的代码拷贝到指定的文件夹,然后完成安装\n\n```\n# HTTPS设置\n```bash\n最好是在主机上安装nginx，然后申请`泛域名证书`，保存到服务器,\n在DNS解析中，添加我们域名到ip的解析记录，然后再nginx的配置文件中\n\n添加按照域名分流设置。需要注意的是nginx转发时 我们也需要使用https\n\n```\n\n# 主机nginx配置修改\n```bash\n1. 所有的80 请求都转发到443端口\n2. 在443端口的http中配置ssl证书\n3. 然后配置多个server,不同的server 设置不同的servername\n\n举个例子\n```\n```nginx.conf\nserver {\n            listen       443 ssl;\n            listen       [::]:443 ssl;\n            server_name  blog.abc.xyz;\n            root         /usr/share/nginx/html;\n\n\n            location ^~ /abc/ {\n                proxy_redirect off;\n                proxy_pass http://127.0.0.1:25500/;\n                proxy_set_header Upgrade $http_upgrade;\n                proxy_set_header Connection \"upgrade\";\n                proxy_set_header Host $host;\n                proxy_set_header X-Real-IP $remote_addr;\n                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n                proxy_set_header REMOTE-HOST $remote_addr;\n            }\n            # 静态资源\n            location ~ .*.(js|css|png|img|gif|jpg|woff2)$ {\n            proxy_pass http://127.0.0.1:25500;\n            }\n\n            error_page 404 /404.html;\n                location = /40x.html {\n            }\n\n            error_page 500 502 503 504 /50x.html;\n                location = /50x.html {\n            }\n    }\n```\n### 首页js cs 无法请求问题\n\n如果首页请求出现`This request has been blocked; the content must be served over HTTPS.`\n说明页面请求了http的元素 但是主页面是https访问的.\n解决方法如下：\n1. 在html元素 头部插入 `\u003cmeta http-equiv=\"Content-Security-Policy\" content=\"upgrade-insecure-requests\"\u003e`\n2. 修改请求api为https\n```js\nfetch('http://URL', {\n    // ...\n    referrerPolicy: \"unsafe_url\" \n});\n```\n但是以上方法对typecho都不太友好.\n解决方法:\n在容器的nginx中同样设置和外层nginx同样的ssl证书,把所有的请求都交给https，这样就不会有问题了。\n```bash\n需要修改docker-compose.yml中nginx下得ssl证书映射路径为\n自己本机的ssl证书\n```\n\n如果本项目对你有帮助，star是对我最大的支持, 万分感谢！\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffireinrain%2Ftypecho-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffireinrain%2Ftypecho-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffireinrain%2Ftypecho-docker/lists"}