version: '2.2'

services:
  gitea:
    image: 'gitea/gitea'
    restart: always
    container_name: gitea
    hostname: gitea
    cpus: 2
    mem_limit: 1g
    mem_reservation: 512m
    volumes:
      - ./data:/data
    expose:
      - "3000"
    depends_on:
      - db
    restart: always
#    cap_add:
#      - NET_ADMIN
    networks:
      mynet:
        ipv4_address: 172.102.0.101
        ipv6_address: 2001:db8:1::101
      haraka:
    hostname: gitea

  db:
    image: mariadb:10
    container_name: gitea-db
    hostname: gitea-db
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=g1t34-
      - MYSQL_DATABASE=gitea
      - MYSQL_USER=gitea
      - MYSQL_PASSWORD=g1t34
    volumes:
      - ./db/:/var/lib/mysql
    networks:
      mynet:
        ipv4_address: 172.102.0.102

networks:
  mynet:
    enable_ipv6: true
    driver: bridge
    ipam:
      config:
      - subnet: 172.102.0.0/24
      - subnet: 2001:db8:1::/64

  haraka:
    external:
      name: harakawildduck_mynet
