From 6105b70fbf997d754f8c3ef1ff25e19abc87b3e5 Mon Sep 17 00:00:00 2001 From: sporada Date: Thu, 25 Mar 2021 14:37:10 +0100 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9Egitea?= =?UTF-8?q?=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Gite service --- gitea/docker-compose.yml | 70 ++++++++++++++++++++++++++++++++++++++++ gitea/live.env.tpl | 11 +++++++ 2 files changed, 81 insertions(+) create mode 100644 gitea/docker-compose.yml create mode 100644 gitea/live.env.tpl diff --git a/gitea/docker-compose.yml b/gitea/docker-compose.yml new file mode 100644 index 0000000..eb47f5e --- /dev/null +++ b/gitea/docker-compose.yml @@ -0,0 +1,70 @@ +version: '3.5' + +networks: + default: + external: + name: traefik_default + +services: + gitea-db: + image: mariadb:10 + container_name: gitea-db + restart: unless-stopped + env_file: live.env + labels: + # Watchtower + - "com.centurylinklabs.watchtower.enable=true" + networks: + - default + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + - ${GITEA_ROOT}/db:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_DATABASE=gitea + + gitea-app: + image: gitea/gitea:latest + container_name: gitea-app + restart: unless-stopped + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + - ${GITEA_ROOT}/data:/data + - /home/git/.ssh/:/data/git/.ssh + + env_file: live.env + environment: + - USER_UID=1000 + - USER_GID=1000 + - DB_TYPE=mysql + - DB_HOST=gitea-db:3306 + - DB_NAME=gitea + - DB_USER=${MYSQL_USER} + - DB_PASSWD=${MYSQL_PASSWORD} + - DOMAIN=gitea.${DOMAIN} + - SSH_PORT=2222 + - DISABLE_REGISTRATION=true + - ROOT_URL=https://gitea.${DOMAIN}/ + - "APP_NAME=Gitea: Git Gud!" + labels: + # Watchtower + - "com.centurylinklabs.watchtower.enable=true" + # Routes + - "traefik.enable=true" + - "traefik.http.routers.gitea.entrypoints=websecure" + - "traefik.http.routers.gitea.rule=Host(`gitea.${DOMAIN}`)" + - "traefik.http.routers.gitea.tls=true" + - "traefik.http.routers.gitea.tls.certresolver=myresolver" + - "traefik.http.services.gitea.loadbalancer.server.port=3000" + - "traefik.tcp.routers.gitea-ssh.rule=HostSNI(`*`)" + - "traefik.tcp.routers.gitea-ssh.entrypoints=ssh" + - "traefik.tcp.routers.gitea-ssh.service=gitea-ssh-svc" + - "traefik.tcp.services.gitea-ssh-svc.loadbalancer.server.port=2222" + depends_on: + - gitea-db + networks: + - default diff --git a/gitea/live.env.tpl b/gitea/live.env.tpl new file mode 100644 index 0000000..de5c1b4 --- /dev/null +++ b/gitea/live.env.tpl @@ -0,0 +1,11 @@ +# MariaDB settings +MYSQL_ROOT_PASSWORD=password_db_root +MYSQL_DATABASE=gitea +MYSQL_USER=gitea +MYSQL_PASSWORD=pasword_db + +# Gitea +GITEA_ROOT=/home/compute/services/gitea + +# Domain +DOMAIN=domain.com