From 01216132ecbf7e292c4f4dd73874b128074e14cf Mon Sep 17 00:00:00 2001 From: Aleksey_Skakodub Date: Sat, 14 Jun 2025 09:16:09 -0400 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=BD=D0=B5=D1=81=20gitea=20=D1=80?= =?UTF-8?q?=D0=B5=D0=BF=D0=BE=D0=B7=D0=B8=D1=82=D0=BE=D1=80=D0=B8=D0=B9=20?= =?UTF-8?q?=D0=B2=20=D0=BE=D1=82=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=B7=20=D0=B0=20=D1=82=D0=B0?= =?UTF-8?q?=D0=BA=D0=B6=D0=B5=20=D0=BE=D1=82=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD?= =?UTF-8?q?=D1=8B=D0=B9=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=B7=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=BF=D1=80=D0=BE=D0=BC=D0=B5=D1=82=D0=B5=D1=83?= =?UTF-8?q?=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gitea-compose.yaml | 35 ++++++++++++++++++++++++++++++++ gitea-runner/config.yaml | 2 +- gitea-runner/data/.runner | 13 ++++++++++++ gitea-runner/docker-compose.yaml | 18 +++++++++++----- monitoring-compose.yaml | 21 +++++++++++++++++++ 5 files changed, 83 insertions(+), 6 deletions(-) create mode 100755 gitea-compose.yaml create mode 100644 gitea-runner/data/.runner create mode 100755 monitoring-compose.yaml diff --git a/gitea-compose.yaml b/gitea-compose.yaml new file mode 100755 index 0000000..6f9c0ff --- /dev/null +++ b/gitea-compose.yaml @@ -0,0 +1,35 @@ +services: + + server: + image: docker.gitea.com/gitea:1.23.7 + container_name: gitea + environment: + - USER_UID=1000 + - USER_GID=1000 + - GITEAdatabaseDB_TYPE=postgres + - GITEAdatabaseHOST=db:5432 + - GITEAdatabaseNAME=gitea + - GITEAdatabaseUSER=gitea + - GITEAdatabasePASSWD=gitea + restart: always + + volumes: + - /home/apotheosis/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 + + volumes: + - /home/apotheosis/postgres:/var/lib/postgresql/data diff --git a/gitea-runner/config.yaml b/gitea-runner/config.yaml index cf2ef50..18165dd 100755 --- a/gitea-runner/config.yaml +++ b/gitea-runner/config.yaml @@ -5,7 +5,7 @@ services: environment: - CONFIG_FILE=/runner/config.yaml - GITEA_INSTANCE_URL=https://super-admins.online - - GITEA_RUNNER_REGISTRATION_TOKEN=WRXwMh6gi6CrF3XddpkH4mcrx8sNpnyBam0FY9gj + - GITEA_RUNNER_REGISTRATION_TOKEN=eEGt8J0BiCoORJg93tZKGSQIHBXJwhyKLT0mR62C volumes: - ./runner-1/config.yaml:/runner/config.yaml - ./runner-1/data:/data diff --git a/gitea-runner/data/.runner b/gitea-runner/data/.runner new file mode 100644 index 0000000..a5f0136 --- /dev/null +++ b/gitea-runner/data/.runner @@ -0,0 +1,13 @@ +{ + "WARNING": "This file is automatically generated by act-runner. Do not edit it manually unless you know what you are doing. Removing this file will cause act runner to re-register as a new runner.", + "id": 2, + "uuid": "e4e25a4a-43dc-4ea9-8f16-01fe13a17f23", + "name": "11fbc94186bc", + "token": "f6adc2a82be7dc8c7ad6b74f794c40752df8d389", + "address": "https://super-admins.online", + "labels": [ + "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest", + "ubuntu-22.04:docker://gitea/runner-images:ubuntu-22.04", + "ubuntu-20.04:docker://gitea/runner-images:ubuntu-20.04" + ] +} diff --git a/gitea-runner/docker-compose.yaml b/gitea-runner/docker-compose.yaml index d9b357b..8727dc3 100755 --- a/gitea-runner/docker-compose.yaml +++ b/gitea-runner/docker-compose.yaml @@ -1,14 +1,22 @@ -version: '3' services: gitea-runner: - image: gitea/act_runner:latest + image: gitea/act_runner container_name: gitea-runner restart: unless-stopped volumes: - /var/run/docker.sock:/var/run/docker.sock - - ./config.yaml:/runner/config.yml - - /var/gitea-runner:/data + - ./config.yml:/runner/config.yml + - ./data:/data environment: - GITEA_INSTANCE_URL=https://super-admins.online - - GITEA_RUNNER_REGISTRATION_TOKEN=9MQVuajOz3ayFbpe4EKYIPSWeFBNOYbEuNwa2xUb + - GITEA_RUNNER_REGISTRATION_TOKEN=eEGt8J0BiCoORJg93tZKGSQIHBXJwhyKLT0mR62C + command: > + sh -c " + if [ ! -f /data/.registered ]; then + act_runner register --no-interactive --instance $${GITEA_INSTANCE_URL} --token $${GITEA_RUNNER_REGISTRATION_TOKEN} && + touch /data/.registered && + act_runner --config /runner/config.yml daemon + else + act_runner --config /runner/config.yml daemon + fi" diff --git a/monitoring-compose.yaml b/monitoring-compose.yaml new file mode 100755 index 0000000..59c21a3 --- /dev/null +++ b/monitoring-compose.yaml @@ -0,0 +1,21 @@ +services: + + node-exporter: + image: prom/node-exporter + container_name: node-exporter + ports: + - "9100:9100" + nginx-exporter: + image: nginx/nginx-prometheus-exporter + container_name: nginx-exporter + ports: + - "9113:9113" + command: + - '-nginx.scrape-uri=http://webserver:8080/stub_status' + postgres-exporter: + image: prometheuscommunity/postgres-exporter + container_name: postgres-exporter + ports: + - "9187:9187" + environment: + DATA_SOURCE_NAME: "postgresql://gitea:gitea@db:5432/gitea?sslmode=disable"