website/_posts/2021-09-05-gitea.md
Sthope ba42ac52b8
All checks were successful
continuous-integration/drone/push Build is passing
initial commit
2021-09-10 11:00:04 +02:00

2.2 KiB

layout title description author image categories comments pic01 pic02 pic03 pic04 pic05 pic06 pic07 pic08 pic09 pic10
post Gitea Gitea docker container sthope
Docker
Portainer
Gitea
Git
true /assets/images/portainer_oauth/1.png /assets/images/portainer_oauth/2.png /assets/images/portainer_oauth/3.png /assets/images/portainer_oauth/4.png /assets/images/portainer_oauth/5.png /assets/images/portainer_oauth/6.png /assets/images/portainer_oauth/7.png /assets/images/portainer_oauth/8.png /assets/images/portainer_oauth/9.png /assets/images/portainer_oauth/10.png

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