
version: "2.4"

services:

  app:
    image: gitea/gitea:1.19.0
    restart: always
    depends_on:
      - db
    ports:
      - 444:444
    volumes:
      - /srv/gitea/data:/data
    environment:
      APP_NAME: "Warpzone Verwaltung"
      RUN_MODE: "prod"
      SSH_DOMAIN: "verwaltung-git.warpzone.ms"
      SSH_PORT: "444"
      ROOT_URL: "https://verwaltung-git.warpzone.ms"
      HTTP_PORT: "42001"
      USER_UID: "1000"
      USER_GID: "1000"
      DB_TYPE: "mysql"
      DB_HOST: "db:3306"
      DB_NAME: "gitea"
      DB_USER: "gitea"
      DB_PASSWD: "{{ mysql_user_pw }}"
    labels:
      - traefik.enable=true
      - traefik.http.routers.{{ servicename }}.rule=Host(`{{ domain }}`)
      - traefik.http.routers.{{ servicename }}.entrypoints=websecure
      - traefik.http.services.{{ servicename }}.loadbalancer.server.port=42001
    networks:
      - default
      - web


  db:
    image: mariadb:10.10.2
    restart: always
    volumes:
      - /srv/gitea/db/:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: "{{ mysql_root_pw }}"
      MYSQL_PASSWORD: "{{ mysql_user_pw }}"
      MYSQL_DATABASE: "gitea"
      MYSQL_USER: "gitea"
    networks:
      - default


networks:
  web:
    external: true    
  default:
    driver: bridge
    enable_ipv6: true
    ipam:
      driver: default
      config:
        # must be a ULA range
        - subnet: fd00:dead:beef:444::/64
