使用Gitea搭建您自己的代码托管服务

使用Docker拉起Gitea,并使用Pigsty的PG作为外部的元数据库

公开Demo地址:<http://git.pigsty.cc>

Gitea 代码托管服务 - 图1

太长;不看

1. cd ~/pigsty/app/gitea; make up

在本例中,Gitea 默认使用 8889 端口,您可以访问以下位置:

<http://git.pigsty> 或 <http://10.10.10.10:8889>

1. make up      # pull up gitea with docker-compose in minimal mode
2. make run     # launch gitea with docker , local data dir and external PostgreSQL
3. make view    # print gitea access point
4. make log     # tail -f gitea logs
5. make info    # introspect gitea with jq
6. make stop    # stop gitea container
7. make clean   # remove gitea container
8. make pull    # pull latest gitea image
9. make rmi     # remove gitea image
10. make save    # save gitea image to /tmp/gitea.tgz
11. make load    # load gitea image from /tmp

使用外部的PostgreSQL

Pigsty默认使用容器内的 Sqlite 作为元数据存储,您可以让 Gitea 通过连接串环境变量使用外部的PostgreSQL

1. # postgres://dbuser_gitea:DBUser.gitea@10.10.10.10:5432/gitea
2. db:   { name: gitea, owner: dbuser_gitea, comment: gitea primary database }
3. user: { name: dbuser_gitea , password: DBUser.gitea, roles: [ dbrole_admin ] }

最后修改 2022-06-05: add app docs for wiki.js (820bfc3)