From 372d60ed2170a4df47e8cc7cbab7e78cb64e037d Mon Sep 17 00:00:00 2001 From: Kris Lamoureux Date: Fri, 20 Oct 2023 00:42:03 -0400 Subject: [PATCH] testing --- LICENSE | 12 +++++++++++ README.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 46 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 docker-compose.yml diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1969ad1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,12 @@ +Copyright (C) 2023 by Kris Lamoureux + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c6dbf23 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# Gitea Deployment Repository +Gitea is excellent as a Git service within Docker environments, boasting +features like simple installation and setup, being lightweight and supporting +the latest Git features. While similar, the docker-compose files available here +cater to different use cases for deploying Gitea. + +## Variables +Here's a brief explanation of the variables used in the docker-compose files: + +### Docker Settings +- `IMAGE`: The name of the Docker image (default: `gitea/gitea`). +- `VERSION`: The tag of the Docker image (default: `latest`). +- `NAME`: The name assigned to the created container (default: `gitea`). + +### Gitea Database Settings +- `DB_TYPE`: The database type (default: `mysql`). +- `DB_HOST`: The database host (default: `host.docker.internal`). +- `DB_NAME`: The database name (default: `gitea`). +- `DB_USER`: The database user (default: `gitea`). +- `DB_PASSWD`: The database password. + +### Gitea Security Settings +- `INSTALL_LOCK`: Lock the installation (default: `true`). +- `REVERSE_PROXY_LIMIT`: Limit for reverse proxies (default: `1`). +- `PROXY_TRUSTED_PROXIES`: Trusted proxies (default: `172.16.0.0/12`). + +### Gitea Server Settings +- `DOMAIN`: The domain for Gitea (default: `git.local.krislamo.org`). +- `SSH_PORT`: The SSH port (default: `127.0.0.1:222`). +- `WEB_PORT`: The web port (default: `127.0.0.1:3000`). + +### Gitea Logging Settings +- `LOG_MODE`: The logging mode (default: `file`). + +### Network Settings +- `NETWORK`: The network to be used (default: `traefik`). + +## Static Configuration + +### Extra Hosts +- `host.docker.internal:host-gateway` is defined for a host-run MariaDB instance + +### Volumes +- `gitea:/data:rw`: Named volume for Gitea data. +- `/home/git/.ssh:/data/git/.ssh:rw`: SSH data. +- `/var/log/gitea:/data/gitea/log:rw`: Log data. +- `/etc/timezone:/etc/timezone:ro` and `/etc/localtime:/etc/localtime:ro`: Timezone data. + +## License +This project is released under the 0BSD license, which allows for unrestricted +use, modification, and distribution. \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4197079 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,46 @@ +version: '3.8' + +volumes: + gitea: + +networks: + traefik: + external: true + +services: + gitea: + image: ${IMAGE:-gitea/gitea}:${VERSION:-latest} + container_name: ${NAME:-gitea} + environment: + USER_GID: ${USER_GID:-1000} + USER_UID: ${USER_UID:-1000} + GITEA__database__DB_TYPE: ${DB_TYPE:-mysql} + GITEA__database__HOST: ${DB_HOST:-host.docker.internal} + GITEA__database__NAME: ${DB_NAME:-gitea} + GITEA__database__PASSWD: ${DB_PASSWD} + GITEA__database__USER: ${DB_USER:-gitea} + GITEA__security__INSTALL_LOCK: ${INSTALL_LOCK:-true} + GITEA__security__REVERSE_PROXY_LIMIT: ${REVERSE_PROXY_LIMIT:-1} + GITEA__security__REVERSE_PROXY_TRUSTED_PROXIES: ${PROXY_TRUSTED_PROXIES:-172.16.0.0/12} + GITEA__server__DOMAIN: ${DOMAIN:-git.local.krislamo.org} + GITEA__server__ROOT_URL: https://${DOMAIN:-git.local.krislamo.org} + GITEA__server__SSH_DOMAIN: ${DOMAIN:-git.local.krislamo.org} + GITEA__service__DISABLE_REGISTRATION: ${DISABLE_REGISTRATION:-false} + GITEA__log__MODE: ${LOG_MODE:-file} + extra_hosts: + - host.docker.internal:host-gateway + labels: + - "traefik.http.routers.${ROUTER:-gitea}.rule=Host(`${DOMAIN:-git.local.krislamo.org}`)" + - "traefik.http.routers.${ROUTER:-gitea}.entrypoints=${ENTRYPOINT:-websecure}" + - "traefik.http.routers.${ROUTER:-gitea}.tls=${ENABLE_TLS:-true}" + - "traefik.http.services.${ROUTER:-gitea}.loadbalancer.server.port=${CONTAINER_PORT:-3000}" + - "traefik.docker.network=${NETWORK:-traefik}" + - "traefik.enable=${TRAEFIK_ENABLE:-true}" + networks: + - ${NETWORK-traefik} + volumes: + - gitea:/data:rw + - /home/git/.ssh:/data/git/.ssh:rw + - /var/log/gitea:/data/gitea/log:rw + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro