update
This commit is contained in:
59
gitea/Demo/GiteaWithNginx/README.md
Normal file
59
gitea/Demo/GiteaWithNginx/README.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# 部署 gitea, 由 nginx 反代
|
||||
|
||||
- 配合 nginx 反代,并单独挂载 indexers 目录
|
||||
- 根据实际环境修改
|
||||
- docker-compose.yml
|
||||
|
||||
- 创建目录
|
||||
```
|
||||
grep '\<source:' docker-compose.yml | cut -d: -f2 | xargs mkdir -p
|
||||
mkdir -p -m 0777 socket
|
||||
```
|
||||
|
||||
- 启动
|
||||
```
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
- 运行 gitea
|
||||
```
|
||||
docker-compose up -d gitea
|
||||
```
|
||||
|
||||
- 停止 gitea
|
||||
```
|
||||
docker-compose down -v
|
||||
```
|
||||
|
||||
- 修改 gitea 配置文件 /compose/gitea/gitea/custom/conf/app.ini
|
||||
```
|
||||
[indexer]
|
||||
...
|
||||
ISSUE_INDEXER_TYPE = bleve
|
||||
ISSUE_INDEXER_PATH = /indexers/issues.bleve
|
||||
ISSUE_INDEXER_QUEUE_TYPE = levelqueue
|
||||
ISSUE_INDEXER_QUEUE_DIR = /indexers/issues.queue
|
||||
REPO_INDEXER_ENABLED = true
|
||||
REPO_INDEXER_PATH = /indexers/repos.bleve
|
||||
UPDATE_BUFFER_LEN = 20
|
||||
MAX_FILE_SIZE = 1048576
|
||||
REPO_INDEXER_INCLUDE = **.go,**.yml,**.toml,**.c,**.h,**makefile,**.py,**.txt,**.ini,**.rs,**.sh,**.md,**Dockerfile*,**docker-entrypoint*,**.cnf,**.conf,**.json,**.sql,**.xml,**.js,**.jsx,**.vue,**.ts,**.tsx,**.html,**.css,**.scss,**.less
|
||||
...
|
||||
|
||||
[server]
|
||||
...
|
||||
PROTOCOL = unix
|
||||
DOMAIN = git.xxxx.com
|
||||
ROOT_URL = http://git.xxxx.com
|
||||
HTTP_ADDR = /socket/gitea
|
||||
UNIX_SOCKET_PERMISSION = 666
|
||||
...
|
||||
```
|
||||
|
||||
- 运行
|
||||
```
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
- 浏览器访问 http://git.xxxx.com
|
||||
|
48
gitea/Demo/GiteaWithNginx/docker-compose.yml
Normal file
48
gitea/Demo/GiteaWithNginx/docker-compose.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
gitea:
|
||||
image: harbor.colben.cn/general/gitea
|
||||
container_name: gitea
|
||||
restart: on-failure
|
||||
stop_grace_period: 1m
|
||||
networks:
|
||||
gitea:
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./gitea/gitea
|
||||
target: /var/lib/gitea
|
||||
- type: bind
|
||||
source: ./gitea/log
|
||||
target: /var/log/gitea
|
||||
- type: bind
|
||||
source: ./gitea/indexers
|
||||
target: /indexers
|
||||
- type: bind
|
||||
source: ./socket
|
||||
target: /socket
|
||||
|
||||
nginx:
|
||||
image: harbor.colben.cn/general/nginx
|
||||
container_name: nginx
|
||||
restart: on-failure
|
||||
stop_grace_period: 1m
|
||||
networks:
|
||||
gitea:
|
||||
ports:
|
||||
- 80:80
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./nginx/http.d
|
||||
target: /etc/nginx/http.d
|
||||
- type: bind
|
||||
source: ./nginx/log
|
||||
target: /var/log/nginx
|
||||
- type: bind
|
||||
source: ./socket
|
||||
target: /socket
|
||||
|
||||
networks:
|
||||
gitea:
|
||||
external: false
|
||||
|
12
gitea/Demo/GiteaWithNginx/nginx/http.d/gitea.conf
Normal file
12
gitea/Demo/GiteaWithNginx/nginx/http.d/gitea.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name git.xxxx.com;
|
||||
access_log off;
|
||||
error_log /var/log/nginx/error-gitea.log;
|
||||
location / {
|
||||
proxy_pass http://unix:/socket/gitea;
|
||||
client_max_body_size 1024m;
|
||||
client_body_buffer_size 1024m;
|
||||
}
|
||||
}
|
||||
|
17
gitea/Demo/SingleNode/README.md
Normal file
17
gitea/Demo/SingleNode/README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# 部署 gitea
|
||||
|
||||
- 根据实际环境修改
|
||||
- docker-compose.yml
|
||||
|
||||
- 创建目录
|
||||
```
|
||||
grep '\<source:' docker-compose.yml | cut -d: -f2 | xargs mkdir -p
|
||||
```
|
||||
|
||||
- 启动
|
||||
```
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
- 访问 http://x.x.x.x:3000
|
||||
|
18
gitea/Demo/SingleNode/docker-compose.yml
Normal file
18
gitea/Demo/SingleNode/docker-compose.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
gitea:
|
||||
image: harbor.colben.cn/general/gitea
|
||||
container_name: gitea
|
||||
restart: "on-failure"
|
||||
stop_grace_period: 1m
|
||||
ports:
|
||||
- 3000:3000
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./gitea/gitea
|
||||
target: /var/lib/gitea
|
||||
- type: bind
|
||||
source: ./gitea/log
|
||||
target: /var/log/gitea
|
||||
|
Reference in New Issue
Block a user