gitea for production

This commit is contained in:
2026-04-19 19:17:25 +00:00
parent 271311ca4c
commit fa76c83ff3
6 changed files with 118 additions and 35 deletions
+45
View File
@@ -0,0 +1,45 @@
# Gitea
## Overview
Self Hosted Git repository.
## Project Details
- **Project Repository:** [Link](https://about.gitea.com/)
- **Container Image:** [Docker Hub](https://hub.docker.com/r/gitea/gitea)
- **Compose Example:** [Compose](https://docs.gitea.com/installation/install-with-docker)
- **Reverse Proxy Port:** `3000`
## Environment Variable Notes
ENABLE_SWAGGER="true" Lets you: Test API calls in browser, See endpoints, Debug integrations
MAX_RESPONSE_ITEMS="15" controls pagination limits for API responses
ROOT_URL - This is what Gitea uses for: Clone URLs, Redirects, Webhooks, OAuth callbacks
LOCAL_ROOT_URL - You can't change the port from 3000, so you don't need this with this configuration.
## Volume Notes
volumes are easy, one for gitea and one for mariadb.
## Network Notes
We connect to the proxy network and have an internal network for db.
## Additional Notes / Gotchas
### 1000 User
We use the 1000 user without option to change.
## Dockhand Stack, Deploy from Git
Cookbooks Repository
stackname: gitea
Compose file path: gitea/compose.yaml
Additional env file (optional): gitea/sample.env
Then "Load" gitea/sample.env into the Environmental variables in dockhand, providing your variables.
Create the Stack
+53
View File
@@ -0,0 +1,53 @@
# Gitea
services:
gitea:
image: ${GITEA_IMAGE}
restart: ${GITEA_RESTART:-always}
volumes:
- ${VOL_PATH}/gitea:/data
environment:
- USER_UID=1000
- USER_GID=1000
- GITEA__database__DB_TYPE=mysql
- GITEA__database__HOST=${GITEA_DB_HOST:-gitea-db:3306}
- GITEA__database__NAME=${GITEA_DB_NAME:-gitea}
- GITEA__database__USER=${GITEA_DB_USER:-gitea}
- GITEA__database__PASSWD=${GITEA_DB_PASS:-changeMe}
- GITEA__server__SSH_DOMAIN=${GITEA_SSH_DOMAIN}
- GITEA__server__PROTOCOL=http
- GITEA__server__DOMAIN=${GITEA_DOMAIN:-git.example.com}
- GITEA__server__ROOT_URL=${GITEA_ROOT_URL:-https://git.example.com/}
- GITEA__server__SSH_PORT=${GITEA_SSH_PORT:-22}
- ENABLE_SWAGGER=true
- MAX_RESPONSE_ITEMS=15
ports:
- ${GITEA_HOST_SSH_PORT:-22}:${GITEA_SSH_PORT:-22}
- ${GITEA_WEB_PORT:-3000}:3000
networks:
- proxy
- db
depends_on:
- gitea-db
gitea-db:
image: ${MARIA_IMAGE:-mariadb:latest}
restart: ${GITEA_RESTART:-always}
volumes:
- ${VOL_PATH}/gitea-db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MARIA_ROOT:-changeMe}
MYSQL_USER: ${GITEA_DB_USER:-gitea}
MYSQL_PASSWORD: ${GITEA_DB_PASS:-changeMe}
MYSQL_DATABASE: ${GITEA_DB_NAME:-gitea}
TZ: ${TZ:-America/Vancouver}
networks:
- db
networks:
proxy:
external: true
db:
driver: bridge
+20
View File
@@ -0,0 +1,20 @@
VOL_PATH=/data
# Gitea
GITEA_IMAGE=gitea/gitea:latest
GITEA_DB_HOST=gitea-db:3306
GITEA_DB_PASS=changeMe
GITEA_DB_NAME=gitea
GITEA_DB_USER=gitea
GITEA_SSH_DOMAIN=git.example.com
GITEA_SSH_PORT=22
GITEA_HOST_SSH_PORT=22
GITEA_WEB_PORT=3000
GITEA_RESTART=always
GITEA_ROOT_URL=https://git.example.com/
GITEA_DOMAIN=git.example.com
# MariaDB
TZ=America/Vancouver
MARIA_IMAGE=mariadb:latest
MARIA_ROOT=changeMe