Gitea

Gitea

Self-hosted Git service

Gitea is a lightweight, open-source self-hosted Git service. It’s a community-managed fork of Gogs with enhanced features focused on Git management and CI/CD integration.

Installation: The following commands will output a new SECRET_KEY and INTERNAL_TOKEN to stdout, which you can then place in your environment variables.

docker run -it --rm docker.gitea.com/gitea:1 gitea generate secret SECRET_KEY
docker run -it --rm docker.gitea.com/gitea:1 gitea generate secret INTERNAL_TOKEN

Do not lose/change your SECRET_KEY after the installation, otherwise the encrypted data can not be decrypted anymore.

🏠 Home: https://about.gitea.com/ 📦 Source: https://github.com/go-gitea/gitea 📜 Docs: https://docs.gitea.com/installation/install-with-docker

TODO: Generate SECRET_KEY and INTERNAL_TOKEN for enhanced security TODO: Consider switching to PostgreSQL for improved performance with large repositories

name: gitea
services:
  gitea:
    image: gitea/gitea:1.24.6
    container_name: gitea
    restart: unless-stopped
    environment:
      TZ: ${TIMEZONE}
      PUID: ${PUID}
      PGID: ${PGID}
      USER_UID: ${PUID}
      USER_GID: ${PGID}
      # Server configuration
      GITEA__server__DOMAIN: gitea.${MYDOMAIN}
      GITEA__server__ROOT_URL: https://gitea.${MYDOMAIN}/
      # SSH configuration
      GITEA__server__SSH_DOMAIN: gitea.${MYDOMAIN}
      GITEA__server__SSH_PORT: 222
      GITEA__server__SSH_LISTEN_PORT: 22
      # Security
      GITEA__security__SECRET_KEY: ${GITEA_SECRET_KEY}
      GITEA__security__INTERNAL_TOKEN: ${GITEA_INTERNAL_TOKEN}
    volumes:
      - ${DOCKER_VOLUMES}/gitea:/data
    networks:
      - proxy
    ports:
      - "222:22"  # SSH port for Git operations
    labels:
      traefik.enable: true
      traefik.http.routers.gitea.rule: Host(`gitea.${MYDOMAIN}`)
      traefik.http.routers.gitea.middlewares: localaccess@file
      traefik.http.services.gitea.loadbalancer.server.port: 3000
      homepage.group: Development
      homepage.name: Gitea
      homepage.icon: gitea.png
      homepage.href: https://gitea.${MYDOMAIN}/
      homepage.description: "Self-hosted Git service"

networks:
  proxy:
    external: true