This commit is contained in:
Kris Lamoureux 2023-10-20 00:38:10 -04:00
commit ae4e01124b
3 changed files with 112 additions and 0 deletions

12
LICENSE Normal file
View File

@ -0,0 +1,12 @@
Copyright (C) 2023 by Kris Lamoureux <kris@lamoureux.io>
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.

51
README.md Normal file
View File

@ -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.

49
docker-compose.yml Normal file
View File

@ -0,0 +1,49 @@
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}
ports:
- ${SSH_PORT-}:22
- ${WEB_PORT-}:3000
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