feat: add README
This commit is contained in:
0
src/gitea/.env.example
Normal file
0
src/gitea/.env.example
Normal file
43
src/gitea/README.md
Normal file
43
src/gitea/README.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# Gitea
|
||||
|
||||
[English](./README.md) | [中文](./README.zh.md)
|
||||
|
||||
This service sets up a Gitea service.
|
||||
|
||||
## Services
|
||||
|
||||
- `server`: The Gitea application service.
|
||||
- `db`: The PostgreSQL database service.
|
||||
|
||||
## Initial Setup
|
||||
|
||||
On the initial setup page, you need to fill in the database information:
|
||||
|
||||
- Database Type: `PostgreSQL`
|
||||
- Host: `db:5432`
|
||||
- User: `gitea`
|
||||
- Password: `gitea` (default)
|
||||
- Database Name: `gitea`
|
||||
|
||||
The first registered user will have administrator privileges.
|
||||
|
||||
## Configuration
|
||||
|
||||
You can configure the basic information of Gitea through the `./config/app.ini` file. For example, you can disable the registration function with the following configuration:
|
||||
|
||||
```ini
|
||||
[service]
|
||||
DISABLE_REGISTRATION = true
|
||||
```
|
||||
|
||||
### Environment Variables
|
||||
|
||||
- `POSTGRES_USER`: The username for the PostgreSQL database, default is `gitea`.
|
||||
- `POSTGRES_PASSWORD`: The password for the PostgreSQL database, default is `gitea`.
|
||||
- `POSTGRES_DB`: The name of the PostgreSQL database, default is `gitea`.
|
||||
|
||||
## Volumes
|
||||
|
||||
- `data`: A volume for storing Gitea data.
|
||||
- `config`: A volume for storing Gitea configuration.
|
||||
- `postgres`: A volume for storing PostgreSQL data.
|
||||
43
src/gitea/README.zh.md
Normal file
43
src/gitea/README.zh.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# Gitea
|
||||
|
||||
[English](./README.md) | [中文](./README.zh.md)
|
||||
|
||||
此服务用于搭建一个 Gitea 服务。
|
||||
|
||||
## 服务
|
||||
|
||||
- `server`: Gitea 应用服务。
|
||||
- `db`: PostgreSQL 数据库服务。
|
||||
|
||||
## 初始设置
|
||||
|
||||
在初始页面需要填入数据库信息:
|
||||
|
||||
- 数据库类型:`PostgreSQL`
|
||||
- 主机:`db:5432`
|
||||
- 用户名:`gitea`
|
||||
- 密码:`gitea`(默认值)
|
||||
- 数据库名称:`gitea`
|
||||
|
||||
第一个注册的用户将拥有管理员权限。
|
||||
|
||||
## 配置
|
||||
|
||||
可以通过 `./config/app.ini` 文件配置 Gitea 的基本信息。例如,通过以下配置可以关闭注册功能:
|
||||
|
||||
```ini
|
||||
[service]
|
||||
DISABLE_REGISTRATION = true
|
||||
```
|
||||
|
||||
### 环境变量
|
||||
|
||||
- `POSTGRES_USER`: PostgreSQL 数据库的用户名,默认为 `gitea`。
|
||||
- `POSTGRES_PASSWORD`: PostgreSQL 数据库的密码,默认为 `gitea`。
|
||||
- `POSTGRES_DB`: PostgreSQL 数据库的名称,默认为 `gitea`。
|
||||
|
||||
## 卷
|
||||
|
||||
- `data`: 用于存储 Gitea 数据的卷。
|
||||
- `config`: 用于存储 Gitea 配置的卷。
|
||||
- `postgres`: 用于存储 PostgreSQL 数据的卷。
|
||||
62
src/gitea/docker-compose.yml
Normal file
62
src/gitea/docker-compose.yml
Normal file
@@ -0,0 +1,62 @@
|
||||
x-default: &default
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- &localtime /etc/localtime:/etc/localtime:ro
|
||||
- &timezone /etc/timezone:/etc/timezone:ro
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 100m
|
||||
|
||||
services:
|
||||
gitea:
|
||||
<<: *default
|
||||
image: gitea/gitea:${GITEA_VERSION:-1.24.6-rootless}
|
||||
environment:
|
||||
- GITEA__database__DB_TYPE=${GITEA_DB_TYPE:-postgres}
|
||||
- GITEA__database__HOST=${GITEA_POSTGRES_HOST:-db:5432}
|
||||
- GITEA__database__USER=${POSTGRES_USER:-gitea}
|
||||
- GITEA__database__NAME=${POSTGRES_DB:-gitea}
|
||||
- GITEA__database__PASSWD=${POSTGRES_PASSWORD:-gitea}
|
||||
volumes:
|
||||
- *localtime
|
||||
- *timezone
|
||||
- gitea_data:/var/lib/gitea
|
||||
- ./config:/etc/gitea
|
||||
ports:
|
||||
- "${GITEA_HTTP_PORT:-3000}:3000"
|
||||
- "${GITEA_SSH_PORT:-3022}:22"
|
||||
depends_on:
|
||||
- db
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.0'
|
||||
memory: 1G
|
||||
reservations:
|
||||
cpus: '0.5'
|
||||
memory: 512M
|
||||
|
||||
db:
|
||||
<<: *default
|
||||
image: postgres:${POSTGRES_VERSION:-17.6}
|
||||
environment:
|
||||
- POSTGRES_USER=${POSTGRES_USER:-gitea}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-gitea}
|
||||
- POSTGRES_DB=${POSTGRES_DB:-gitea}
|
||||
volumes:
|
||||
- *localtime
|
||||
- *timezone
|
||||
- postgres:/var/lib/postgresql/data
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.0'
|
||||
memory: 1G
|
||||
reservations:
|
||||
cpus: '0.5'
|
||||
memory: 512M
|
||||
|
||||
volumes:
|
||||
gitea_data:
|
||||
postgres:
|
||||
Reference in New Issue
Block a user