mirror of
https://github.com/nickyeoman/docker-compose-cookbooks.git
synced 2026-09-04 02:46:23 +00:00
gitea for production
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -1,6 +0,0 @@
|
||||
# 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
|
||||
@@ -1,20 +0,0 @@
|
||||
services:
|
||||
|
||||
gitea:
|
||||
image: ${GITEA_IMAGE:-gitea/gitea:latest}
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
- DB_TYPE=mysql
|
||||
- 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:
|
||||
- ${VOL_PATH:-./data}/gitea:/data
|
||||
ports:
|
||||
- "${GITEA_PORT}:22"
|
||||
- "${GITEA_WEB_PORT}:3000"
|
||||
@@ -1,9 +0,0 @@
|
||||
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_SSH_PORT=22
|
||||
GITEA_WEB_PORT=3000
|
||||
GITEA_SSH_DOMAIN=example.com
|
||||
Reference in New Issue
Block a user