目录
目录结构
composer.json
config.json
satis.sh
首页 开发工具 composer 快速搭建composer内网代码仓库

快速搭建composer内网代码仓库

Aug 03, 2021 pm 03:14 PM
composer docker php Satis

下面由composer教程栏目给大家介绍Docker怎么搭建内网composer satis代码仓库,希望对需要的朋友有所帮助!

快速搭建composer内网代码仓库

搭建composer内网代码仓库

拉取 composer/satis 镜像

docker pull composer/satis

配置 composer

该步骤可跳过

目录结构

├── auth.json
├── cache
│   ├── files
│   ├── repo
│   └── vcs
├── composer.json
└── config.json

composer.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
│   │   └── all$f3811758e4611a4dfc1a96f4d1c06da09cdbe199.json
│   ├── index.html
│   └── packages.json
└── satis.sh

config.json

{
    "name": "composer_satis_test",
    "homepage": "http://local.satis.com",
    "repositories": [
        {
            "type": "git",
            "name": "zhanghuizong/composer_satis_test",
            "url": "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 指定获取哪些包,如果想获取所有包,使用require-all: true
archive.directory output-dir 即使build的输出目录
archive.format 可选,默认:zip, 支持两种压缩格式:zip,tar。build时采用的压缩格式
archive.skip-dev 可选,默认情况下为false,启用时(true)satis不会为分支机构创建下载
archive.prefix-url 可选的下载位置,主页(来自satis.json),默认情况下是目录
官网说明:https://docs.phpcomposer.com/articles/handling-private-packages-with-satis.html
GitHub代码:https://github.com/composer/satis

shell 脚本

satis.sh

#!/usr/bin/env bash

docker run --rm --init -it -v "$(pwd)"/config.json:/satis.json:ro \
-v "$(pwd)"/public/:/build \
-v /mnt/d/workspaces/docker-config/composer/:/composer \
composer/satis build /satis.json /build "$@"

增加快捷访问

编辑文件:vi ~/.bashrc

alias satis='docker run --rm --init -it -v "$(pwd)"/config.json:/satis.json:ro -v "$(pwd)"/public/:/build -v /mnt/d/workspaces/docker-config/composer/:/composer composer/satis build /satis.json /build'

用法

# 构建所有代码仓库模块
sh satis.sh

# 安装指定模块
sh satis.sh zhanghuizong/composer_satis_test

注意

指定模块安装,repositories 节点中必须配置 name 字段,同时与 require 节点配置对应上

nginx 配置

server {
        listen        80;
        server_name  local.satis.com;
        root   "/data/httpd/docker-config/composer_satis/test/public/";
        location / {
            index index.php index.html;
        }

        location ~ \.php(.*)$ {
            fastcgi_pass   php:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}

593fd9e56dd375e338137968cb686c4.png

以上是快速搭建composer内网代码仓库的详细内容。更多信息请关注PHP中文网其他相关文章!

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

热门话题

PHP教程
1594
276
如何使用PHP中的阵列 如何使用PHP中的阵列 Aug 20, 2025 pm 07:01 PM

phparrayshandledatAcollectionsefefityIndexedorassociativuctures; hearecreatedWithArray()或[],访问decessedviakeys,modifybyAssignment,iteratifybyAssign,iteratedwithforeach,andManipulationUsfunsionsFunctionsLikeCountLikeCountLikeCountLikeCountLikecount()

如何在php中使用$ _cookie变量 如何在php中使用$ _cookie变量 Aug 20, 2025 pm 07:00 PM

$_COOKIEisaPHPsuperglobalforaccessingcookiessentbythebrowser;cookiesaresetusingsetcookie()beforeoutput,readvia$_COOKIE['name'],updatedbyresendingwithnewvalues,anddeletedbysettinganexpiredtimestamp,withsecuritybestpracticesincludinghttponly,secureflag

描述观察者的设计模式及其在PHP中的实现。 描述观察者的设计模式及其在PHP中的实现。 Aug 15, 2025 pm 01:54 PM

TheObserverdesignpatternenablesautomaticnotificationofdependentobjectswhenasubject'sstatechanges.1)Itdefinesaone-to-manydependencybetweenobjects;2)Thesubjectmaintainsalistofobserversandnotifiesthemviaacommoninterface;3)Observersimplementanupdatemetho

PHPMYADMIN安全最佳实践 PHPMYADMIN安全最佳实践 Aug 17, 2025 am 01:56 AM

要有效保护phpMyAdmin,必须采取多层安全措施。1.通过IP限制访问,仅允许可信IP连接;2.修改默认URL路径为不易猜测的名称;3.使用强密码并创建权限最小化的专用MySQL用户,推荐启用双因素认证;4.保持phpMyAdmin版本最新以修复已知漏洞;5.加固Web服务器和PHP配置,禁用危险函数并限制文件执行;6.强制使用HTTPS加密通信,防止凭证泄露;7.不使用时禁用phpMyAdmin或增加HTTP基本认证;8.定期监控日志并配置fail2ban防御暴力破解;9.删除setup和

使用XSLT参数创建动态转换 使用XSLT参数创建动态转换 Aug 17, 2025 am 09:16 AM

XSLT参数是通过外部传递值来实现动态转换的关键机制,1.使用声明参数并可设置默认值;2.从应用程序代码(如C#)通过XsltArgumentList等接口传入实际值;3.在模板中通过$paramName引用参数控制条件处理、本地化、数据过滤或输出格式;4.最佳实践包括使用有意义的名称、提供默认值、分组相关参数并进行值验证。合理使用参数可使XSLT样式表具备高复用性和可维护性,相同样式表能根据不同输入产生多样化输出结果。

如何使用作曲家使用环境变量 如何使用作曲家使用环境变量 Aug 14, 2025 pm 04:27 PM

Composerallowsenvironmentvariableinterpolationincomposer.jsonusing${VAR_NAME}syntax,butonlyinfieldslikescripts,extra,andconfig—notinrequireorautoload.2.Youcansetvariablesinlinewhenrunningcommands,suchasAPP_ENV=productioncomposerinstall,tocontrolbehav

您目前尚未使用附上的显示器[固定] 您目前尚未使用附上的显示器[固定] Aug 19, 2025 am 12:12 AM

Ifyousee"YouarenotusingadisplayattachedtoanNVIDIAGPU,"ensureyourmonitorisconnectedtotheNVIDIAGPUport,configuredisplaysettingsinNVIDIAControlPanel,updatedriversusingDDUandcleaninstall,andsettheprimaryGPUtodiscreteinBIOS/UEFI.Restartaftereach

您将如何在PHP应用程序中实现API版本? 您将如何在PHP应用程序中实现API版本? Aug 14, 2025 pm 11:14 PM

APIversioninginPHPcanbeeffectivelyimplementedusingURL,header,orqueryparameterapproaches,withURLandheaderversioningbeingmostrecommended.1.ForURL-basedversioning,includetheversionintheroute(e.g.,/v1/users)andorganizecontrollersinversioneddirectories,ro

See all articles