Gitea

by on
1 minute read

Gitea docker container

Portainer Stack:

---
version: "3.8"

networks:
  EXTERNAL:
    external:
      name: EXTERNAL
  INTERNAL:
    external:
      name: INTERNAL

services:
  gitea:
    image: gitea/gitea:latest
    restart: unless-stopped
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
    networks: 
      - EXTERNAL
      - INTERNAL
    volumes:
      - /gitea/data:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3000:3000"
      - "22:22"
    labels:
      - com.centurylinklabs.watchtower.enable=true
    depends_on:
      - gitea_db
      
  gitea_db:
    image: ghcr.io/linuxserver/mariadb:latest
    container_name: gitea_db
    networks:
      - INTERNAL
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=qtzZzVt4sRcAt682
      - MYSQL_DATABASE=z7twLnmEmK7A3FMv
      - MYSQL_USER=b2nngTxbJXbGUHkz
      - MYSQL_PASSWORD=yBDK68gAwJrp3Pgp
      - TZ=Europe/Lisbon
    restart: unless-stopped
    volumes:
      - /gitea/db:/config
    labels:
      - com.centurylinklabs.watchtower.enable=true
      - hide_db_container=true

If you are running reverse proxy in same docker you might not need the ports in the stack, otherwise change them from the default.
Also before running the container, create the folders for Gitea and the DB and change the volumes to math. Run on the Terminal id $USER to know what are your PUID/USER_UID and PGID/USER_GID.

Official Documentation

comments powered by Disqus