컴포저 튜토리얼 칼럼에서는 Docker로 인트라넷 컴포저 만족 코드 웨어하우스를 구축하는 방법을 소개하겠습니다. 필요한 친구들에게 도움이 되길 바랍니다! ㅋㅋㅋ
이 단계는 건너뛸 수 있습니다.
디렉터리 구조
1
docker pull composer/satis
로그인 후 복사
composer.json1
2
3
4
5
6
7
├── auth.json
├── cache
│ ├── files
│ ├── repo
│ └── vcs
├── composer.json
└── config.json
로그인 후 복사
config.json
빌딩 모듈 확장
디렉터리 구조
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"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 1
2
3
4
5
6
7
8
9
10
├── config.json
├──
public
│ ├── dist
│ │ ├── bpc
│ │ └── zhanghuizong
│ ├──
include
│ │ └── all
$f3811758e4611a4dfc1a96f4d1c06da09cdbe199
.json
│ ├── index.html
│ └── packages.json
└── satis.sh
로그인 후 복사
키워드
설명
repositories
패키지를 얻을 위치 지정
require
어떤 패키지를 얻을지 지정하려면 require-all: true
archive.directoryoutput-dir을 사용하세요. 빌드의 출력 디렉터리 archive.format선택 사항, 기본값: zip, zip, tar의 두 가지 압축 형식을 지원합니다. 빌드할 때 사용되는 압축 형식 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쉘 스크립트satis.sh1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"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"
}
}
로그인 후 복사
빠른 액세스 추가파일 편집: vi ~/.bashrcUsage1
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'
로그인 후 복사
Note 모듈 설치를 지정하려면, 이름 필드는 리포지토리 노드에서 구성되어야 하며 필수 노드 구성nginx 구성
1
2
3
4
5
6
#!/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
"$@"
로그인 후 복사
1
2
3
4
5
# 构建所有代码仓库模块
sh satis.sh
# 安装指定模块
sh satis.sh zhanghuizong/composer_satis_test
로그인 후 복사
과 일치해야 합니다.위 내용은 Composer 인트라넷 코드 웨어하우스를 신속하게 구축의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!