147 lines
4.5 KiB
YAML
147 lines
4.5 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
# ---------- PostgreSQL 数据库 ----------
|
|
pg-gitea:
|
|
image: postgres:16
|
|
container_name: pg-gitea
|
|
restart: always
|
|
ports:
|
|
- "127.0.0.1:5433:5432"
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: change-me-strong
|
|
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=en_US.UTF-8"
|
|
volumes:
|
|
- ./data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks: [ proxy_net ]
|
|
|
|
# ---------- Gitea ----------
|
|
gitea:
|
|
image: gitea/gitea:1.24-rootless
|
|
container_name: gitea
|
|
restart: always
|
|
depends_on:
|
|
pg-gitea:
|
|
condition: service_healthy
|
|
environment:
|
|
# 下列 env 只是兜底;最终以挂载的 app.ini 为准
|
|
GITEA__database__DB_TYPE: postgres
|
|
GITEA__database__HOST: pg-gitea:5432
|
|
GITEA__database__NAME: gitea
|
|
GITEA__database__USER: postgres
|
|
GITEA__database__PASSWD: change-me-strong
|
|
volumes:
|
|
- ./gitea/conf/app.ini:/etc/gitea/app.ini
|
|
- ./gitea/data:/data
|
|
ports:
|
|
- "8418:3000" # 100.64.0.27:8418
|
|
- "2222:2222"
|
|
networks: [ proxy_net ]
|
|
|
|
# ---------- Runner 轻载 #1 ----------
|
|
runner-light-1:
|
|
image: gitea/act_runner:latest
|
|
container_name: gitea-runner-light-1
|
|
restart: always
|
|
depends_on:
|
|
gitea:
|
|
condition: service_started
|
|
environment:
|
|
- CONFIG_FILE=/config.yaml
|
|
- GITEA_INSTANCE_URL=http://100.64.0.27:8418
|
|
- GITEA_RUNNER_REGISTRATION_TOKEN=dG0bchxPJSH5D0T74RYqf6CrL7HdngQy5gxYgjmV
|
|
- HTTP_PROXY=http://proxy:7890
|
|
- HTTPS_PROXY=http://proxy:7890
|
|
- NO_PROXY=localhost,127.0.0.1,pg-gitea,proxy,100.64.0.0/10,*.consul
|
|
volumes:
|
|
- ./runners/runner-light-1/config.yaml:/config.yaml:ro
|
|
- ./runners/runner-light-1/data:/data
|
|
- ./runners/runner-light-1/cache:/root
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
networks: [ proxy_net ]
|
|
cpus: "6"
|
|
mem_limit: "12g"
|
|
|
|
# ---------- Runner 轻载 #2 ----------
|
|
runner-light-2:
|
|
image: gitea/act_runner:latest
|
|
container_name: gitea-runner-light-2
|
|
restart: always
|
|
depends_on:
|
|
gitea:
|
|
condition: service_started
|
|
environment:
|
|
- CONFIG_FILE=/config.yaml
|
|
- GITEA_INSTANCE_URL=http://100.64.0.27:8418
|
|
- GITEA_RUNNER_REGISTRATION_TOKEN=dG0bchxPJSH5D0T74RYqf6CrL7HdngQy5gxYgjmV
|
|
- HTTP_PROXY=http://proxy:7890
|
|
- HTTPS_PROXY=http://proxy:7890
|
|
- NO_PROXY=localhost,127.0.0.1,pg-gitea,proxy,100.64.0.0/10,*.consul
|
|
volumes:
|
|
- ./runners/runner-light-2/config.yaml:/config.yaml:ro
|
|
- ./runners/runner-light-2/data:/data
|
|
- ./runners/runner-light-2/cache:/root
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
networks: [ proxy_net ]
|
|
cpus: "6"
|
|
mem_limit: "12g"
|
|
|
|
# ---------- Runner 构建型 #1 ----------
|
|
runner-build-1:
|
|
image: gitea/act_runner:latest
|
|
container_name: gitea-runner-build-1
|
|
restart: always
|
|
depends_on:
|
|
gitea:
|
|
condition: service_started
|
|
environment:
|
|
- CONFIG_FILE=/config.yaml
|
|
- GITEA_INSTANCE_URL=http://100.64.0.27:8418
|
|
- GITEA_RUNNER_REGISTRATION_TOKEN=dG0bchxPJSH5D0T74RYqf6CrL7HdngQy5gxYgjmV
|
|
- HTTP_PROXY=http://proxy:7890
|
|
- HTTPS_PROXY=http://proxy:7890
|
|
- NO_PROXY=localhost,127.0.0.1,pg-gitea,proxy,100.64.0.0/10,*.consul
|
|
volumes:
|
|
- ./runners/runner-build-1/config.yaml:/config.yaml:ro
|
|
- ./runners/runner-build-1/data:/data
|
|
- ./runners/runner-build-1/cache:/root
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
networks: [ proxy_net ]
|
|
cpus: "10"
|
|
mem_limit: "32g"
|
|
|
|
# ---------- Runner 构建型 #2 ----------
|
|
runner-build-2:
|
|
image: gitea/act_runner:latest
|
|
container_name: gitea-runner-build-2
|
|
restart: always
|
|
depends_on:
|
|
gitea:
|
|
condition: service_started
|
|
environment:
|
|
- CONFIG_FILE=/config.yaml
|
|
- GITEA_INSTANCE_URL=http://100.64.0.27:8418
|
|
- GITEA_RUNNER_REGISTRATION_TOKEN=dG0bchxPJSH5D0T74RYqf6CrL7HdngQy5gxYgjmV
|
|
- HTTP_PROXY=http://proxy:7890
|
|
- HTTPS_PROXY=http://proxy:7890
|
|
- NO_PROXY=localhost,127.0.0.1,pg-gitea,proxy,100.64.0.0/10,*.consul
|
|
volumes:
|
|
- ./runners/runner-build-2/config.yaml:/config.yaml:ro
|
|
- ./runners/runner-build-2/data:/data
|
|
- ./runners/runner-build-2/cache:/root
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
networks: [ proxy_net ]
|
|
cpus: "10"
|
|
mem_limit: "32g"
|
|
|
|
networks:
|
|
proxy_net:
|
|
external: true
|
|
name: proxy_net
|