From 3566fdfbee69c9de5d219a41c34319adcb091ea6 Mon Sep 17 00:00:00 2001 From: Nick Yeoman Date: Sun, 10 Nov 2024 22:59:04 -0800 Subject: [PATCH] updated gitea --- gitea/README.md | 6 +++++ gitea/docker-compose.yml | 55 +++++----------------------------------- gitea/env-sample | 11 -------- gitea/sample-extends.yml | 12 +++++++++ gitea/sample.env | 8 ++++++ 5 files changed, 33 insertions(+), 59 deletions(-) create mode 100644 gitea/README.md delete mode 100644 gitea/env-sample create mode 100644 gitea/sample-extends.yml create mode 100644 gitea/sample.env diff --git a/gitea/README.md b/gitea/README.md new file mode 100644 index 0000000..e42c791 --- /dev/null +++ b/gitea/README.md @@ -0,0 +1,6 @@ +# Gitea + +Dockerhub: https://hub.docker.com/r/gitea/gitea +Docker Compose: https://docs.gitea.com/installation/install-with-docker-rootless/docker-compose.yml + +Reverse Proxy Port: 3000 diff --git a/gitea/docker-compose.yml b/gitea/docker-compose.yml index 740e27b..c0dfa22 100644 --- a/gitea/docker-compose.yml +++ b/gitea/docker-compose.yml @@ -1,62 +1,21 @@ -################################################################################ -# Gitea -# make sure you use the $PREFIX from .env for project_name -# docker-compose -p project_name up -d -# -# Importing directly to the db (phpmydadmin) -# you have to run the following in the container: -# php artisan bookstack:regenerate-permissions -# -# Version 1 -################################################################################ -version: '3.3' - -volumes: - gitea: - gitea-db: - -networks: - admin_web: - external: - name: admin_web +version: '3.8' services: - gitea-db: - image: mariadb:${DB_V} - restart: always - volumes: - - gitea-db:/var/lib/mysql - networks: - - admin_web - environment: - MYSQL_ROOT_PASSWORD: ${GITEA_MYSQL_ROOT_PASSWORD} - MYSQL_USER: gitea - MYSQL_PASSWORD: ${GITEA_MYSQL_PASSWORD} - MYSQL_DATABASE: gitea - gitea: - # https://hub.docker.com/r/gitea/gitea - image: gitea/gitea:${GITEA_V} - networks: - - admin_web + image: ${GITEA_IMAGE:-gitea/gitea:latest} environment: - USER_UID=1000 - USER_GID=1000 - DB_TYPE=mysql - - DB_HOST=${PREFIX}_gitea-db:3306 + - DB_HOST=${GITEA_DB_HOST:-gitea-mariadb:3306} - DB_NAME=gitea - DB_USER=gitea + - SSH_DOMAIN=${GITEA_SSH_DOMAIN:-example.com} + - ENABLE_SWAGGER="true" + - MAX_RESPONSE_ITEMS="15" restart: always volumes: - - gitea:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro + - ${VOL_PATH:-./data}/gitea:/data ports: - "${GITEA_PORT}:22" - labels: - - "traefik.enable=true" - - "traefik.http.routers.${PREFIX}_gitea.rule=Host(`${GITEA_DOMAIN_NAME}`)" - - "traefik.http.routers.${PREFIX}_gitea.entrypoints=websecure" - - "traefik.http.routers.${PREFIX}_gitea.tls.certresolver=letsencrypt" - - "traefik.http.services.${PREFIX}_gitea.loadbalancer.server.port=3000" diff --git a/gitea/env-sample b/gitea/env-sample deleted file mode 100644 index bb4ea46..0000000 --- a/gitea/env-sample +++ /dev/null @@ -1,11 +0,0 @@ -# Domains & Project -PREFIX=p1 -GITEA_DOMAIN_NAME=gitea.nickyeoman.com - -# Software versions -GITEA_V=1.11.4 -GITEA_PORT=22 - -#passwords -GITEA_MYSQL_ROOT_PASSWORD=changeMe -GITEA_MYSQL_PASSWORD=changemeAlso diff --git a/gitea/sample-extends.yml b/gitea/sample-extends.yml new file mode 100644 index 0000000..d8962de --- /dev/null +++ b/gitea/sample-extends.yml @@ -0,0 +1,12 @@ +version: '3.4' + +services: + gitea: + extends: + file: ${COOKBOOK}/gitea/docker-compose.yml + service: gitea + + gitea-mariadb: + extends: + file: ${COOKBOOK}/mariadb/docker-compose.yml + service: mariadb \ No newline at end of file diff --git a/gitea/sample.env b/gitea/sample.env new file mode 100644 index 0000000..29565ec --- /dev/null +++ b/gitea/sample.env @@ -0,0 +1,8 @@ +COOKBOOK=/git/docker-compose-cookbooks #HELP: cookbooks +VOL_PATH=./data #HELP: volpath + +# Gitea +GITEA_IMAGE=gitea/gitea:latest +GITEA_DB_HOST=gitea-db:3306 +GITEA_PORT=22 +GITEA_SSH_DOMAIN=example.com \ No newline at end of file