Forgejo
Forgejo is a community-driven, self-hosted Git forge — a soft fork of Gitea focused on sustainability, independence, and community governance. It provides Git repository hosting, issue tracking, pull requests, code review, CI/CD via Forgejo Actions (GitHub Actions compatible), container registry, package registry, and a wiki per repository. This stack deploys Forgejo 8 backed by PostgreSQL 16 for reliable data storage. Forgejo is lightweight and can run on minimal hardware while supporting thousands of repositories and users. It supports SSH access for Git operations, OAuth2/OpenID Connect authentication, webhooks, and an extensive API compatible with the Gitea ecosystem. After deployment, access the web UI on port 3000 to complete the installation wizard and create your admin account.
Enthaltene Services
forgejo
codeberg.org/forgejo/forgejo:8
Umgebungsvariablen:
postgres
postgres:16-alpine
Umgebungsvariablen:
Generiertes YAML
# Generated by ComposeHub (composehub.dev)
name: forgejo
services:
forgejo:
image: codeberg.org/forgejo/forgejo:8
restart: always
ports:
- 3000:3000
- 2222:22
volumes:
- forgejo_data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
environment:
USER_UID: ${USER_UID:-1000}
USER_GID: ${USER_GID:-1000}
FORGEJO__database__DB_TYPE: postgres
FORGEJO__database__HOST: postgres:5432
FORGEJO__database__NAME: ${POSTGRES_DB:-forgejo}
FORGEJO__database__USER: ${POSTGRES_USER:-forgejo}
FORGEJO__database__PASSWD: ${POSTGRES_PASSWORD:-changeme}
FORGEJO__server__ROOT_URL: ${ROOT_URL:-http://localhost:3000}
FORGEJO__server__SSH_PORT: ${SSH_PORT:-2222}
FORGEJO__server__SSH_LISTEN_PORT: "22"
networks:
- forgejo
depends_on:
postgres:
condition: service_healthy
healthcheck:
test:
- CMD-SHELL
- curl -f http://localhost:3000/api/v1/version || exit 1
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
deploy:
resources:
limits:
cpus: "2.00"
memory: 1024M
reservations:
cpus: "0.25"
memory: 128M
labels:
com.composehub.description: Forgejo Git forge — code hosting, CI/CD, and project management
postgres:
image: postgres:16-alpine
restart: always
volumes:
- forgejo_db:/var/lib/postgresql/data
environment:
POSTGRES_DB: ${POSTGRES_DB:-forgejo}
POSTGRES_USER: ${POSTGRES_USER:-forgejo}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
networks:
- forgejo
healthcheck:
test:
- CMD-SHELL
- pg_isready -U ${POSTGRES_USER:-forgejo} -d ${POSTGRES_DB:-forgejo}
interval: 5s
timeout: 5s
retries: 10
start_period: 30s
deploy:
resources:
limits:
cpus: "1.00"
memory: 512M
reservations:
cpus: "0.25"
memory: 128M
labels:
com.composehub.description: PostgreSQL 16 database for Forgejo
networks:
forgejo:
driver: bridge
volumes:
forgejo_data:
driver: local
forgejo_db:
driver: local
Kurzinfo
- Services
- 2
- Netzwerke
- 1
- Volumes
- 2
Wann verwenden
Dieses Template ist ideal für die Einrichtung einer forgejo Umgebung. Alle Services sind mit Healthchecks, Ressourcenlimits und sinnvollen Standardwerten vorkonfiguriert. Passen Sie die Umgebungsvariablen an, bevor Sie in Produktion gehen.
Tipps
- Ändern Sie alle Standardpasswörter vor dem Deployment
- Überprüfen Sie die Ressourcenlimits für Ihre Hardware
- Fügen Sie einen Reverse Proxy für HTTPS in Produktion hinzu
- Konfigurieren Sie Backup-Strategien für Daten-Volumes