Files
Deployments/Gitea/README.md
2020-04-26 19:38:48 +08:00

77 lines
2.0 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Gitea
## 官网
https://gitea.io/en-us/
## 用途
低配置要求的Gitlab替代。
## 文件说明
* `docker-compose.yml`:服务配置;
## 安装说明
1. 解析域名到你的服务器;
2. 安装docker-compose参考 <a href="https://www.4spaces.org/centos-install-docker-compose/" target="_blank">CENTOS安装Docker Compose</a>
3. 完成NginxAndLetsencrypt的部署
参见相关说明。包含把sample.conf改名为gitea.conf或其他名字
4. 在/srv下复制gitea目录。cd进gitea
5. 在/srv/gitea下chmod +x ./grant-permissions.sh
6. 执行该sh脚本。注意可以通过tail -2 /etc/passwd和tail -2 /etc/group 查看新注册用户的uid和gid。如和docker-compose.yml中的不符合则应修改yml文件。
7. 执行 docker inspect nginxdocker_nginx_1 来确定nginx所在网络名称
```
"Networks": {
"nginxdocker_default": {
```
8. 执行 docker network inspect nginxdocker_default 来确定一些网络信息:
```
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "192.168.16.0/20",
"Gateway": "192.168.16.1"
}
]
},
```
9. 根据上述两点网络相关的信息修改gitea的docker-compose文件中的对应部分并指定固定IP。
9. 将需要nginx代理的应用设置的固定IP填入之前的gitea.conf。
11. 重启nginx的docker容器。
12. 启动gitea的docker-compose
13. ```
docker-compose up -d
```
## 使用说明
- 配置文件在:/srv/gitea/gitea/gitea/conf下的app.ini
- 邮件smtp服务器要带端口号通常是25
- 注意对于大项目的首次push有可能上传请求体大小超出Nginx限制。注意相关配置。参考https://blog.csdn.net/yedajiang44/article/details/99294216
## 测试环境
* CentOS Linux release 7.3.1611 (Core)
```
```