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.
Servizi Inclusi
forgejo
codeberg.org/forgejo/forgejo:8
Variabili d'Ambiente:
postgres
postgres:16-alpine
Variabili d'Ambiente:
YAML Generato
# 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
Informazioni Rapide
- Servizi
- 2
- Reti
- 1
- Volumi
- 2
Quando Usarlo
Questo template è ideale per configurare un ambiente forgejo Tutti i servizi sono preconfigurati con healthchecks, limiti di risorse e valori predefiniti sensati. Personalizza le variabili d'ambiente prima di fare il deploy in produzione.
Consigli
- Cambia tutte le password predefinite prima del deploy
- Verifica i limiti di risorse per il tuo hardware
- Aggiungi un reverse proxy per HTTPS in produzione
- Configura strategie di backup per i volumi di dati