commit acd31dc2ad43c1ef24c0033e02e025ffefb4279b Author: dreamcmi <1912544842@qq.com> Date: Thu Aug 20 18:03:18 2026 +0800 init diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..702fca2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,61 @@ +networks: + gitea: + external: false + +services: + server: + image: docker.gitea.com/gitea:1.27.2 + container_name: gitea + environment: + - USER_UID=1000 + - USER_GID=1000 + - GITEA__database__DB_TYPE=postgres + - GITEA__database__HOST=db:5432 + - GITEA__database__NAME=gitea + - GITEA__database__USER=gitea + - GITEA__database__PASSWD=gitea + restart: always + networks: + - gitea + volumes: + - ./gitea:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "3000:3000" + - "222:22" + depends_on: + - db + + db: + image: docker.io/library/postgres:14 + restart: always + environment: + - POSTGRES_USER=gitea + - POSTGRES_PASSWORD=gitea + - POSTGRES_DB=gitea + networks: + - gitea + volumes: + - ./postgres:/var/lib/postgresql/data + + runner: + image: gitea/runner:3.1.0-dind + networks: + - gitea + restart: always + privileged: true + depends_on: + - server + volumes: + - ./data/runner:/data + - ./runner_config:/config + environment: + - CONFIG_FILE=/config/config.yaml + - GITEA_INSTANCE_URL=http://server:3000 + - DOCKER_HOST=unix:///var/run/docker.sock + # When using Docker Secrets, it's also possible to use + # GITEA_RUNNER_REGISTRATION_TOKEN_FILE to pass the location. + # The env var takes precedence. + # Needed only for the first start. + - GITEA_RUNNER_REGISTRATION_TOKEN=jf23hhmhg1Q4nzHEMgU2hj9FVPe3KpztZLWoeDE3 diff --git a/runner_config/config.yaml b/runner_config/config.yaml new file mode 100644 index 0000000..084a83a --- /dev/null +++ b/runner_config/config.yaml @@ -0,0 +1,5 @@ +log: + level: info +container: + docker_host: unix:///var/run/docker.sock + network: host