Docker搭建内网 composer satis 代码仓库

搭建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, 支持两种压缩格式:ziptar。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 "[email protected]"

增加快捷访问

编辑文件: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;
        }
}

原文地址:https://www.cnblogs.com/zhanghuizong/p/12693303.html

时间: 2024-08-28 04:16:33

Docker搭建内网 composer satis 代码仓库的相关文章

搭建内网yum仓库

编译源码,根据自己的需求做成定制RPM包–>搭建内网yum仓库–yum安装. [root@www ~]# uname -aLinux www 2.6.32-642.6.2.el6.x86_64 #1 SMP Wed Oct 26 06:52:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux [root@www ~]# cat /etc/redhat-release CentOS release 6.8 (Final) =================定制化R

用NAT123搭建内网WCF服务并实现安卓APP访问附带站点简单的性能测试

以下原创,转转请注明出处,谢谢合作! 简介:NAT123是个很很强大的工具,而且使用非常简单,真正实现了帮用户无视内外网的建站服务. 这里简单介绍一下如何用NAT123建内网WCF服务,然后用一个安卓APP实现对它的调用,由于NAT123提供全端口映射(需要访问者支持),所以既可以做站点,APP后台,也可以做其他应用的服务器比如FTP等等,根据具体应用的需要而定.最后对所建的两个映射站点做了个简单的性能测试. 用NAT123搭建内网WCF服务:(由于文章主要是介绍NAT123,WCF相关内容自行

debian下搭建内网centos源(apache2)

生产环境中有一些机器没外网 也不允许有外网 领导要求搭建内网centos源 涉及ip如下: 10.1.1.1(服务端) 10.1.1.2(客户端) 现服务端已有CentOS-6.5-x86_64-bin-DVD1.iso  cat /etc/debian_version  5.0.2 服务端(10.1.1.1) 1.创建iso挂载目录 mkdir /opt/iso/centos -p 2.挂载iso mount -o loop /opt/isos/CentOS-6.5-x86_64-bin-DV

RadHat搭建内网YUM源服务器

前言:随着内网linux服务器越来越多,在每台服务器上安装软件,都要先把安装盘上传上去,在配置本地yum服务,即麻烦又费时.可以在内网的一台linux服务器上安装yum服务,然后其他服务器直接修改repo文件使用yum服务就可以了.安装步骤如下: Linux系统环境 1.RHEL版本 [[email protected] pub]# cat /etc/issue Red Hat Enterprise Linux Server release 6.5 (Santiago) 2.内核版本 [[ema

Apache James搭建内网邮件服务器

Apache James搭建内网邮件服务器 极客521 | 极客521 2014-08-21 148 阅读 java 大概之前两个礼拜的日子,讨论会介绍了关于了.net内网邮件服务器的搭建.所以自己也很有必要来尝试一把邮件服务器的搭建,这里选取的是james这个工具. 为什么要使用内网邮件服务器? a.安全这里仅限个人观点.对于任何一个企业来说,必要安全保密是非常重要的. b.不受internet的限制虽然说现在到处都是wifi,但是有一个能够自己来控制和使用的邮件服务器肯定是不错的选择. 什么

搭建内网NTP时间服务器

          搭建内网的NTP时间服务器 需求:搭建一台时间服务器,使得无外网的服务器可以同步时间. 一.环境 1. [[email protected] ~]# cat /etc/redhat-release 2. CentOS release 6.8 (Final) 3. [[email protected] ~]# hostname -I 4. 10.0.0.61 172.16.1.61 5. #外网10.0.0.61;内网172.16.1.61 二.安装ntp并检查是否安装成功 1

利用云服务器搭建内网映射服务器

应用背景:众所周知,随着公网IP地址的短缺,即使电信联通这样的一级运营商在提供宽带服务的时候有时候也会使用私网IP地址,更不用说长城.鹏博士这样的二级运营商了,肯定都是提供的私网IP地址,那么对于一个计算机发烧友来讲,经常会使用很多服务,但是这些服务往往都是搭建在自己本地的电脑上的,可是为了让公网能够测试访问,就必须使用端口映射技术,如果有幸获取到公网IP则可以不必继续读下去,如果为了省钱,购买了二级运营商的宽带,抑或是教育网的同学们想利用自己的校园网搭建一些公网服务进行测试或者学习怎么办呢?那

CentOS 7.2 搭建内网ntp时间服务器

时间服务器说明 前面在系统的基础优化里说到了时间同步需要同步aliyun的时间,这样我们所有的服务器都需要到公网去同步时间,浪费很多网络资源,这里我们来搭建一下内网的时间服务器. 环境说明 1.时间服务器环境介绍 # cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) # uname -r 3.10.0-327.el7.x86_64 # hostname -I 192.168.56.100 172.16.1.100 2.内网需

CentOS 6.8使用bind搭建内网DNS主从服务

1.DNS域名解析服务说明 > DNS域名解析服务(Domain Name System)是用于解析域名与IP地址对应关系的服务,功能上可以实现正向解析与反向解析:正向解析:根据主机名(域名)查找对应的IP地址.反向解析:根据IP地址查找对应的主机名(域名). 工作形式上又分主服务器.从服务器和缓存服务器. 主服务器:在特定区域内具有唯一性.负责维护该区域内的域名与IP地址对应关系. 从服务器:从主服务器中获得域名与IP地址对应关系并维护,以防主服务器宕机等情况. 缓存服务器:通过向其他域名解析