93 lines
2.7 KiB
YAML
93 lines
2.7 KiB
YAML
version: '3.8'
|
|
|
|
# Gitea - Self-Hosted Git Service with Database
|
|
# Application Layer
|
|
# Ports: 3002 (HTTP), 2222 (SSH)
|
|
# GPU: No
|
|
# Storage: SSD (repositories, database)
|
|
|
|
services:
|
|
gitea-db:
|
|
image: postgres:14-alpine
|
|
container_name: gitea-db
|
|
restart: unless-stopped
|
|
volumes:
|
|
# Database on SSD for performance
|
|
- /home/jpmschweitzer/docker-data/gitea/db:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_USER=gitea
|
|
- POSTGRES_PASSWORD=gPdM7QV4gvotE9f9lGS4yj
|
|
- POSTGRES_DB=gitea
|
|
- TZ=Europe/Amsterdam
|
|
networks:
|
|
- docker-dataplane
|
|
|
|
gitea:
|
|
image: gitea/gitea:latest
|
|
container_name: gitea
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3002:3000" # HTTP web interface
|
|
- "2222:22" # SSH git access (mapped to avoid host SSH conflict)
|
|
volumes:
|
|
# Git repositories and app config on SSD
|
|
- /home/jpmschweitzer/docker-data/gitea/data:/data
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
environment:
|
|
- USER_UID=1000
|
|
- USER_GID=1000
|
|
- GITEA__database__DB_TYPE=postgres
|
|
- GITEA__database__HOST=gitea-db:5432
|
|
- GITEA__database__NAME=gitea
|
|
- GITEA__database__USER=gitea
|
|
- GITEA__database__PASSWD=gPdM7QV4gvotE9f9lGS4yj
|
|
- TZ=Europe/Amsterdam
|
|
depends_on:
|
|
- gitea-db
|
|
networks:
|
|
- docker-dataplane
|
|
|
|
networks:
|
|
docker-dataplane:
|
|
external: true
|
|
name: docker-dataplane
|
|
|
|
# ⚠️ SECURITY WARNING:
|
|
# Change POSTGRES_PASSWORD and GITEA__database__PASSWD before deploying!
|
|
# Use a strong, unique password.
|
|
#
|
|
# After Deployment:
|
|
# 1. Access http://localhost:3002
|
|
# 2. First-time setup:
|
|
# - Server domain: localhost:3002 or your domain
|
|
# - SSH server domain: localhost
|
|
# - SSH server port: 2222 (external)
|
|
# - HTTP listen port: 3000 (internal)
|
|
# - Application URL: http://localhost:3002 or https://git.schweitz.net (if using NPM)
|
|
# - Database: PostgreSQL (pre-configured via environment variables)
|
|
# - Create admin account (strong password!)
|
|
# 3. Configure additional settings:
|
|
# - Email settings (optional)
|
|
# - Enable/disable user registration
|
|
# - Configure webhooks and integrations
|
|
#
|
|
# SSH Git Clone Usage:
|
|
# git clone ssh://git@localhost:2222/username/repo.git
|
|
#
|
|
# Nginx Proxy Manager Setup (for external access):
|
|
# 1. Add proxy host: git.schweitz.net → http://gitea:3000
|
|
# 2. Enable SSL with Let's Encrypt
|
|
# 3. Update GITEA__server__ROOT_URL in environment to https://git.schweitz.net
|
|
#
|
|
# Features:
|
|
# - Git repository hosting
|
|
# - Organizations and teams
|
|
# - Issue tracking
|
|
# - Pull requests and code review
|
|
# - Wiki and project documentation
|
|
# - CI/CD integration (Gitea Actions)
|
|
# - Webhooks for automation
|
|
# - Migration from GitHub/GitLab
|
|
# - Lightweight and fast
|