From f446e784ccdd9830297641a396b0a93a6d1b5819 Mon Sep 17 00:00:00 2001 From: TheH2SO4 <69685986+theh2so4@users.noreply.github.com> Date: Fri, 3 Nov 2023 12:21:15 +0100 Subject: [PATCH] [+] Template: Gitea (MySQL) --- templates/compose/gitea-with-mysql.yaml | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 templates/compose/gitea-with-mysql.yaml diff --git a/templates/compose/gitea-with-mysql.yaml b/templates/compose/gitea-with-mysql.yaml new file mode 100644 index 000000000..2ade4f015 --- /dev/null +++ b/templates/compose/gitea-with-mysql.yaml @@ -0,0 +1,45 @@ +# documentation: https://docs.gitea.com +# slogan: Gitea is a self-hosted, lightweight Git service, offering version control, collaboration, and code hosting. +# tags: version control, collaboration, code, hosting, lightweight, mysql + +services: + gitea: + image: gitea/gitea:latest + environment: + - SERVICE_FQDN_GITEA + - USER_UID=1000 + - USER_GID=1000 + - GITEA__database__DB_TYPE=mysql + - GITEA__database__HOST=mysql + - GITEA__database__NAME=${MYSQL_DATABASE-gitea} + - GITEA__database__USER=$SERVICE_USER_MYSQL + - GITEA__database__PASSWD=$SERVICE_PASSWORD_MYSQL + volumes: + - gitea-data:/var/lib/gitea + - gitea-timezone:/etc/timezone:ro + - gitea-localtime:/etc/localtime:ro + labels: + - "traefik.http.services.gitea-websecure.loadbalancer.server.port=3000" + depends_on: + mysql: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:3000"] + interval: 2s + timeout: 10s + retries: 15 + + mysql: + image: mysql:8.0 + volumes: + - gitea-mysql-data:/var/lib/mysql + environment: + - MYSQL_USER=${SERVICE_USER_MYSQL} + - MYSQL_PASSWORD=${SERVICE_PASSWORD_MYSQL} + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_ROOT_PASSWORD=${SERVICE_PASSWORD_MYSQLROOT} + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-h", "localhost"] + interval: 5s + timeout: 20s + retries: 10