当前位置: 首页 > 后端技术 > PHP

Docker搭建内网composersatis代码仓库

时间:2023-03-29 15:37:26 PHP

搭建composer内网代码仓库pullcomposer/satisimagedockerpullcomposer/satisConfigurecomposer这一步可以跳过目录结构├──auth.json├──cache│├──files│├──repo│└──vcs├──composer.json└──config.jsoncomposer.json{}config.json{"config":{"secure-http":false,"optimize-autoloader":false,"preferred-install":"dist","sort-packages":true,"platform":{}},"repositories":{"packagist":{"type":"composer","url":"https://mirrors.aliyun.com/composer/"}}}构建模块扩展目录结构├──config.json├──public│├──dist││├──bpc││└──zhanghuizong│├──include││└──alljson{"name":"composer_satis_test","homepage":"http://local.satis.com","repositories":[{"type":"git","name":"zhanghuizong/composer_satis_test","网址“:”https://gitee.com/zhanghuizong/composer_satis_test.git"}],"require":{"zhanghuizong/composer_satis_test":"*"},"archive":{"directory":"dist","format":"tar","skip-dev":true,"prefix-url":"http://local.satis.com"}}关键字描述repositories指定获取包的位置require指定获取哪些包,如果你想getallPackage,使用require-all:truearchive.directoryoutput-dir即使build的输出目录是可选的,archive.format是可选的,默认:zip,支持两种压缩格式:zip,tar.压缩格式archive。build时使用的skip-dev是可选的,默认为false,启用时(true)satis不会为分支创建下载archive.prefix-url可选下载位置,首页(来自satis.json),默认为官方目录网站描述:https://docs.phpcomposer.com/articles/handling-private-packages-with-satis.htmlGitHub代码:https://github.com/composer/satisshell脚本satis.sh#!/usr/bin/envbashdockerrun--rm--init-it-v"$(pwd)"/config.json:/satis.json:ro\-v"$(pwd)"/public/:/build\-v/mnt/d/workspaces/docker-config/composer/:/composer\composer/satisbuild/satis.json/build"$@"添加快速访问编辑文件:vi~/.bashrcaliassatis='泊坞窗运行--rm--init-it-v"$(pwd)"/config.json:/satis.json:ro-v"$(pwd)"/public/:/build-v/mnt/d/workspaces/docker-config/composer/:/composercomposer/satisbuild/satis.json/build'Usage#构建所有代码仓库模块shsatis.sh#安装指定模块shsatis.shzhanghuizong/composer_satis_test注意安装指定模块,并且repositoriesnode字段中必须配置name,对应nginx配置服务器上requirenode配置{listen80;服务器名称local.satis.com;根目录“/data/httpd/docker-config/composer_satis/test/public/”;location/{indexindex.phpindex.html;}location~\.php(.*)${fastcgi_passphp:9000;fastcgi_indexindex.php;fastcgi_split_path_info^((?U).+\.php)(/?.+)$;fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;fastcgi_paramPATH_INFO$fastcgi_path_info;fastcgi_paramPATH_TRANSLATED$document_root$fastcgi_path_info;包括fastcgi_params;}}