:::info 视频演示 https://www.bilibili.com/video/BV1Z341127Vh/ :::
官方说明
最简安装
cat > docker-compose.yml << EOF
version: "3.7"
services:
gitea:
image: gitea/gitea:1.15.3
container_name: gitea
restart: always
environment:
USER_UID: 1000
USER_GID: 1000
# http 本机 IP
DOMAIN: $(ip a |grep inet|egrep 'eth|ens'|grep '[192|172].*/' -o|cut -d '/' -f 1)
# 禁用 ssh
DISABLE_SSH: 'true'
# 禁用安装界面
INSTALL_LOCK: 'true'
ports:
- "3000:3000"
volumes:
- ./data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
EOF
带库安装(PG)
cat > docker-compose.yml << EOF
version: "3.7"
services:
gitea:
image: gitea/gitea:1.15.3
container_name: gitea
restart: always
environment:
USER_UID: 1000
USER_GID: 1000
# http 本机 IP
DOMAIN: $(ip a |grep inet|egrep 'eth|ens'|grep '[192|172].*/' -o|cut -d '/' -f 1)
# 禁用 ssh
DISABLE_SSH: 'true'
# 禁用安装界面
INSTALL_LOCK: 'true'
# pg 库配置
DB_TYPE: 'postgres'
DB_HOST: 'db:5432'
DB_NAME: 'gitea'
DB_USER: 'gitea'
DB_PASSWD: 'gitea'
ports:
- "3000:3000"
volumes:
- ./data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
depends_on:
- db
db:
image: postgres:13-alpine
restart: always
environment:
- POSTGRES_USER=gitea
- POSTGRES_PASSWORD=gitea
- POSTGRES_DB=gitea
volumes:
- ./db:/var/lib/postgresql/data
EOF
使用
管理员
建组织
建仓库
克隆仓库
推送仓库
离线模式
:::info 内网部署中需设置离线模式 :::
sed -i "s/OFFLINE_MODE.*/OFFLINE_MODE=true/" ./data/gitea/conf/app.ini