前置条件: https://www.hcjike.com/archives/BsOgZbge https://www.hcjike.com/archives/64T5tBWw
1、创建专属桥接网络 {#1%E3%80%81%E5%88%9B%E5%BB%BA%E4%B8%93%E5%B1%9E%E6%A1%A5%E6%8E%A5%E7%BD%91%E7%BB%9C}
若已创建,可跳过此步骤。 https://www.hcjike.com/archives/tMUqkbKb
2、部署服务 {#2%E3%80%81%E9%83%A8%E7%BD%B2%E6%9C%8D%E5%8A%A1}
2.1、Compose配置 {#2.1%E3%80%81compose%E9%85%8D%E7%BD%AE}
services:
gitea:
image: commitgo/gitea-ee:latest
container_name: gitea
environment:
- PUID=1000
- PGID=10
- GITEA__database__DB_TYPE=mysql
- GITEA__database__HOST=mysql:3306
- GITEA__database__NAME=数据库名称
- GITEA__database__USER=数据库管理权的账号
- GITEA__database__PASSWD=账号对应的密码
restart: always
networks:
- app_network
volumes:
- ./data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "http端口:3000"
- "SSH链接时的端口:22"
networks:
app_network:
external: true
2.2、进入网站完成安装 {#2.2%E3%80%81%E8%BF%9B%E5%85%A5%E7%BD%91%E7%AB%99%E5%AE%8C%E6%88%90%E5%AE%89%E8%A3%85}
地址为:http://{内网IP地址}:40000
2.3、注意事项 {#2.3%E3%80%81%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9}
-
管理员用户不能填写
admin
; -
以上设置若设置后需要修改,则需前往存储空间
./data:/data
设置的宿主机路径下的./gitea/conf/app.ini
,文件下载后按照官方文档修改,更新文件后重启容器完成修改。
2.4、其他参考 {#2.4%E3%80%81%E5%85%B6%E4%BB%96%E5%8F%82%E8%80%83}
https://www.hcjike.com/archives/AJrtIgMX https://www.hcjike.com/archives/PWRL9tXj https://www.hcjike.com/archives/EqS9Kf2Z