Gitea behind Traefik with docker-compose

What is Gitea?

Gitea is an open-source forge software package that hosts Git-based software development version control. It is a simple, self-hosted all-in-one software development solution with capabilities such as Git hosting, code review, team collaboration, a package registry, and continuous integration/continuous delivery (CI/CD). It has a simple user interface that allows for easy control of repositories on your own servers.

Because it is self-hosted, it allows developers to create their own private repositories, providing them control over their data and coding resources. A big developer community contributes to the platform's continuous evolution and the implementation of new functionalities. It supports collaborative features such as bug tracking, wikis, and code reviews, making it useful for team-based software development projects.

To summarize, Gitea is a dynamic and comprehensive platform that provides advanced version control features, seamless interfaces, and a priority on boosting collaboration and efficiency throughout the software development lifecycle to development teams.

Getting Started

Requirements

To start with Gotify behined the Traefik you need to follow the instructions from the traefik with docker-compose post.

Optional you can keep this service up to date with the instructions from the watchtower with docker-compose post.

Create your docker-compose.yml

## docker-compose.yml
version: '3.8'
# network is optional just needed with gotify
networks:
  default:
   name: "demo_gitea_db_net"
   external: false
 traefik:
   name: "traefik_net"
   external: true
services: gitea: image: "gitea/gitea:latest" container_name: "${PROJECT_NAME}_gitea" hostname: "gitea.localhost" environment: - "USER_UID=1000" - "USER_GID=1000" - "GITEA__database__DB_TYPE=mysql" - "GITEA__database__HOST=db:3306" - "GITEA__database__NAME=gitea" - "GITEA__database__USER=USER" - "GITEA__database__PASSWD=PASSWORD" restart: "unless-stopped" networks: - "default" - "traefik" volumes: - "./data/git:/data" - "/etc/timezone:/etc/timezone:ro" - "/etc/localtime:/etc/localtime:ro" depends_on: - "db" labels: # Watchtower add to auto update (optional) - "com.centurylinklabs.watchtower.enable=true" # traefik - "traefik.enable=true" - "traefik.docker.network=traefik_net" - "traefik.http.routers.demo_gitea.rule=Host(`gitea.localhost`)" - "traefik.http.services.demo_gitea.loadbalancer.server.port=3000" - "traefik.http.routers.demo_gitea.entrypoints=websecure" - "traefik.http.routers.demo_gitea.tls=true" db: image: "mariadb:latest" container_name: "demo_gitea_db" restart: "unless-stopped" environment: - "MYSQL_ROOT_PASSWORD=ROOTPASSWORD" - "MYSQL_DATABASE=gitea" - "MYSQL_USER=USER" - “MYSQL_PASSWORD=PASSWORD” volumes: - "./data/db:/var/lib/mysql" labels: # Watchtower add to auto update (optional) - "com.centurylinklabs.watchtower.enable=true" # traefik - "traefik.enable=false"

Start your docker-compse.yml

Now you can start your service with:

docker compose up -d

now you can access the gitea inital configuration at https://gitea.localhost.

you can find the example on my git server.