{"id":20756445,"url":"https://github.com/lirongtong/miitvip-nginx-php-fastdfs","last_synced_at":"2026-01-17T14:56:16.074Z","repository":{"id":116702018,"uuid":"295595451","full_name":"lirongtong/miitvip-nginx-php-fastdfs","owner":"lirongtong","description":"Docker 镜像  :smirk: 集成了 PHP + Nginx + FastDFS，用于搭建 FastDFS 分布式文件服务系统，已上传至 Docker Hub，:boom: 具体的安装方式可以查看扩展链接 :point_down:","archived":false,"fork":false,"pushed_at":"2023-12-22T09:04:07.000Z","size":67,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-28T14:02:31.338Z","etag":null,"topics":["docker","docker-hub","dockerfile","fastdfs","nginx","php"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/miitvip/nginx-php-fastdfs","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lirongtong.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}},"created_at":"2020-09-15T02:42:48.000Z","updated_at":"2023-02-02T06:41:13.000Z","dependencies_parsed_at":"2023-12-22T10:25:06.243Z","dependency_job_id":"7ef2c09b-84eb-4cc2-a6d6-0aa3adb2c732","html_url":"https://github.com/lirongtong/miitvip-nginx-php-fastdfs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lirongtong/miitvip-nginx-php-fastdfs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lirongtong%2Fmiitvip-nginx-php-fastdfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lirongtong%2Fmiitvip-nginx-php-fastdfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lirongtong%2Fmiitvip-nginx-php-fastdfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lirongtong%2Fmiitvip-nginx-php-fastdfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lirongtong","download_url":"https://codeload.github.com/lirongtong/miitvip-nginx-php-fastdfs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lirongtong%2Fmiitvip-nginx-php-fastdfs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28510926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"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":["docker","docker-hub","dockerfile","fastdfs","nginx","php"],"created_at":"2024-11-17T09:32:25.258Z","updated_at":"2026-01-17T14:56:16.032Z","avatar_url":"https://github.com/lirongtong.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker 镜像\r\n\r\n\u003e 集成 FastDFS, Nginx, PHP 等多种软件的 Docker 镜像, 免除 FastDFS 构建文件管理服务过程中一系列的关联服务的繁琐操作，该镜像已经上传至 Docker Hub.\r\n\u003e \u003e\r\n\u003e FastDFS: 一个开源的轻量级分布式文件系统, 解决大容量存储和负载均衡问题 ( [https://github.com/happyfish100/fastdfs](https://github.com/happyfish100/fastdfs) ) .\r\n\u003e \u003e\r\n\u003e 镜像构建: `docker build -t miitvip/nginx-php-fastdfs .`\r\n\r\n## 0. 更新说明\r\n\r\n```shell\r\n[ ------------ 2022-12-20 ------------ ]\r\n1. php 更新至 8.2.0\r\n2. nginx 更新至 1.22.1\r\n3. php redis 更新至 5.3.7\r\n\r\n\r\n[ ------------ 2019-12-19 ------------ ]\r\n1. php 更新至 7.4.1\r\n\r\n\r\n[ ------------ 2019-11-29 ------------ ]\r\n1. nginx 更新至 1.17.6\r\n2. php 更新至 7.3.12\r\n3. 新增 composer\r\n4. 更新启动脚本 start.sh\r\n```\r\n\r\n## 1. 拉取镜像\r\n\r\n`docker pull miitvip/nginx-php-fastdfs`\r\n\r\n## 2. 创建目录\r\n\r\n```shell\r\n# 运行之前，创建好相应的文件目录，例如：\r\n\r\nmkdir -p /miitvip/logs/php \\\r\n/miitvip/logs/nginx \\\r\n/miitvip/docker/nginx/ \\\r\n/miitvip/docker/nginx/ssl \\\r\n/miitvip/docker/nginx/letsencrypt \\\r\n/miitvip/docker/fastdfs/tracker \\\r\n/miitvip/docker/fastdfs/storage \\\r\n/miitvip/docker/fastdfs/client \\\r\n/miitvip/docker/fastdfs/conf \\\r\n/miitvip/web/fastdfs\r\n```\r\n\r\n## 3. 临时容器\r\n\r\n`docker run --name php -p 9000:9000 -d --restart=always miitvip/nginx-php-fastdfs php`\r\n\r\n## 4. 进入容器\r\n\r\n`docker exec -it php /bin/bash`\r\n\r\n## 5. 查看信息\r\n\r\n```shell\r\nphp -r 'phpinfo();'\r\n\r\n# 注意如下两个信息\r\n...\r\nConfiguration File (php.ini) Path =\u003e /usr/local/etc/php\r\nextension_dir =\u003e /usr/local/lib/php/extensions/no-debug-non-zts-20180731\r\n...\r\n```\r\n\r\n## 6. 复制文件\r\n\r\n```shell\r\n# docker ps 查看容器信息\r\n# 666f8de6d689 为刚刚启动的临时 PHP 容器ID 或可以直接将 id 改成 name\r\n\r\ndocker cp 666f8de6d689:/usr/local/lib/php/extensions/no-debug-non-zts-20180731/ /miitvip/docker/php/\r\nmv /miitvip/docker/php/no-debug-non-zts-20180731 /miitvip/docker/php/ext\r\ndocker cp 666f8de6d689:/usr/local/etc/php/php.ini /miitvip/docker/php/php.ini\r\n\r\n```\r\n\r\n## 7. 启动 php\r\n\r\n```shell\r\n# 关闭临时 PHP 并删除后再次启动 PHP\r\n# 注意 -v /miitvip/web:/www 的映射需要与 nginx 两边保持一致\r\n\r\ndocker stop php\r\ndocker rm php\r\ndocker run --name php -p 9000:9000 \\\r\n-v /miitvip/web:/www:rw \\\r\n-v /miitvip/logs/php:/var/log/php \\\r\n-v /miitvip/docker/php/ext:/usr/local/lib/php/extensions/no-debug-non-zts-20180731 \\\r\n-v /miitvip/docker/php/php.ini:/usr/local/etc/php/php.ini \\\r\n-d --restart=always --link mysql:mysql miitvip/nginx-php-fastdfs php\r\n\r\n```\r\n\r\n## 8. 启动 nginx\r\n\r\n```shell\r\ndocker run -d -ti --name nginx \\\r\n-p 80:80 -p 443:443 \\\r\n-v /miitvip/web:/www \\\r\n-v /miitvip/logs/nginx:/var/log/nginx \\\r\n-v /miitvip/docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro \\\r\n-v /miitvip/docker/nginx/conf.d:/etc/nginx/conf.d \\\r\n-v /miitvip/docker/nginx/ssl:/etc/nginx/ssl \\\r\n-v /miitvip/docker/nginx/letsencrypt:/etc/nginx/letsencrypt \\\r\n-v /miitvip/web/fastdfs:/fastdfs/store \\\r\n--link php:php \\\r\n--restart=always miitvip/nginx-php-fastdfs nginx\r\n```\r\n\r\n## 9. 启动 fastdfs\r\n\r\n```shell\r\ndocker run -d -ti --name fastdfs \\\r\n-p 8888:8888 -p 22122:22122 -p 23000:23000 \\\r\n-e GROUP_NAME=MIIT \\\r\n-e TRACKER_SERVER=服务器IP地址 \\\r\n-v /miitvip/docker/fastdfs/tracker:/fastdfs/tracker \\\r\n-v /miitvip/docker/fastdfs/storage:/fastdfs/storage \\\r\n-v /miitvip/docker/fastdfs/client:/fastdfs/client \\\r\n-v /miitvip/docker/fastdfs/conf/tracker.conf:/etc/fdfs/tracker.conf \\\r\n-v /miitvip/docker/fastdfs/conf/storage.conf:/etc/fdfs/storage.conf \\\r\n-v /miitvip/docker/fastdfs/conf/mod_fastdfs.conf:/etc/fdfs/mod_fastdfs.conf \\\r\n-v /miitvip/docker/fastdfs/conf/client.conf:/etc/fdfs/client.conf \\\r\n-v /miitvip/docker/fastdfs/conf/http.conf:/etc/fdfs/http.conf \\\r\n-v /miitvip/web/fastdfs:/fastdfs/store \\\r\n--restart=always miitvip/nginx-php-fastdfs fastdf\r\n```\r\n\r\n## 10. 测试\r\n\r\n```shell\r\ndocker exec -it fastdfs /bin/bash\r\n/usr/bin/fdfs_monitor /etc/fdfs/storage.conf\r\n\r\n# 执行后出现如下提示信息\r\nDEBUG - base_path=/fastdfs/storage, connect_timeout=10, network_timeout=60, tracker_server_count=1,\r\nanti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0,\r\ng_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0\r\n\r\nserver_count=1, server_index=0\r\n\r\ntracker server is 你的服务器IP:22122\r\n\r\ngroup count: 1\r\n\r\nGroup 1:\r\ngroup name = MIIT\r\ndisk total space = 50,26700 MB\r\ndisk free space = 41,44800 MB\r\ntrunk free space = 0 MB\r\nstorage server count = 1\r\nactive server count = 1\r\nstorage server port = 23000\r\nstorage HTTP port = 8888\r\nstore path count = 1\r\nsubdir count per path = 256\r\ncurrent write server index = 0\r\ncurrent trunk file id = 0\r\n\r\n Storage 1:\r\n  id = 106.52.100.29\r\n  ip_addr = 你的服务器IP  ACTIVE\r\n  http domain = \r\n  version = 6.06\r\n  join time = 2020-01-01 09:43:23\r\n  up time = 2020-01-01 09:43:23\r\n  total storage = 50,26700 MB\r\n  free storage = 41,44800 MB\r\n  upload priority = 10\r\n  store_path_count = 1\r\n  subdir_count_per_path = 256\r\n  storage_port = 23000\r\n  storage_http_port = 8888\r\n  current_write_path = 0\r\n  source storage id = \r\n  if_trunk_server = 0\r\n  connection.alloc_count = 256\r\n  connection.current_count = 0\r\n  connection.max_count = 0\r\n  total_upload_count = 0\r\n  success_upload_count = 0\r\n  total_append_count = 0\r\n  success_append_count = 0\r\n  total_modify_count = 0\r\n  success_modify_count = 0\r\n  total_truncate_count = 0\r\n  success_truncate_count = 0\r\n  total_set_meta_count = 0\r\n  success_set_meta_count = 0\r\n  total_delete_count = 0\r\n  success_delete_count = 0\r\n  total_download_count = 0\r\n  success_download_count = 0\r\n  total_get_meta_count = 0\r\n  success_get_meta_count = 0\r\n  total_create_link_count = 0\r\n  success_create_link_count = 0\r\n  total_delete_link_count = 0\r\n  success_delete_link_count = 0\r\n  total_upload_bytes = 0\r\n  success_upload_bytes = 0\r\n  total_append_bytes = 0\r\n  success_append_bytes = 0\r\n  total_modify_bytes = 0\r\n  success_modify_bytes = 0\r\n  stotal_download_bytes = 0\r\n  success_download_bytes = 0\r\n  total_sync_in_bytes = 0\r\n  success_sync_in_bytes = 0\r\n  total_sync_out_bytes = 0\r\n  success_sync_out_bytes = 0\r\n  total_file_open_count = 0\r\n  success_file_open_count = 0\r\n  total_file_read_count = 0\r\n  success_file_read_count = 0\r\n  total_file_write_count = 0\r\n  success_file_write_count = 0\r\n  last_heart_beat_time = 2020-01-02 07:15:27\r\n  last_source_update = 1970-01-01 00:00:00\r\n  last_sync_update = 1970-01-01 00:00:00\r\n  last_synced_timestamp = 1970-01-01 00:00:00\r\n```\r\n\r\n## 11. 问题\r\n\r\n\u003e 若 FastDFS 启动失败，请进入 fastdfs 容器，手动启动 tracker \u0026 storage 后再试\r\n\r\n```shell\r\ndocker exec -it fastdfs /bin/bash\r\n/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start\r\n/usr/bin/fdfs_storaged /etc/fdfs/storage.conf start\r\n\r\n# 再次查看是否正常\r\n/usr/bin/fdfs_monitor /etc/fdfs/storage.conf\r\n```\r\n\r\n\u003e 重启 nginx\r\n\r\n```shell\r\ndocker restart nginx\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flirongtong%2Fmiitvip-nginx-php-fastdfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flirongtong%2Fmiitvip-nginx-php-fastdfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flirongtong%2Fmiitvip-nginx-php-fastdfs/lists"}