gitea.yml

 

2023-07-24

Docker Compose 配置文件:

1
version: "3"
2
3
networks:
4
gitea:
5
external: false
6
7
services:
8
server:
9
image: gitea/gitea:latest
10
container_name: gitea
11
environment:
12
- USER_UID=1000
13
- USER_GID=1000
14
- GITEA__database__DB_TYPE=mysql
15
- GITEA__database__HOST=db:3306
16
- GITEA__database__NAME=gitea
17
- GITEA__database__USER=gitea
18
- GITEA__database__PASSWD=gitea.
19
restart: always
20
networks:
21
- gitea
22
volumes:
23
- /data/gitea:/data
24
- /etc/timezone:/etc/timezone:ro
25
- /etc/localtime:/etc/localtime:ro
26
ports:
27
- "3000:3000"
28
- "22:22"
29
depends_on:
30
- db
31
32
db:
33
image: mysql:latest
34
restart: always
35
environment:
36
- MYSQL_ROOT_PASSWORD=password
37
- MYSQL_USER=gitea
38
- MYSQL_PASSWORD=gitea
39
- MYSQL_DATABASE=gitea
40
networks:
41
- gitea
42
volumes:
43
- /data/mysql:/var/lib/mysql
  • 安装界面不需要另行设置 ssh 端口和服务端口
  • 可禁用注册和访问
  • 安装过程有点慢