networks:
  web:
    enable_ipv6: true
    ipam:
      config:
        - subnet: "172.20.0.0/16"
        - subnet: "fd3a:138e:8fd0:0020::/64"
  monero:
    enable_ipv6: true
    ipam:
      config:
        - subnet: "172.21.0.0/16"
        - subnet: "fd3a:138e:8fd0:0021::/64"
  game:
    enable_ipv6: true
    ipam:
      config:
        - subnet: "172.22.0.0/16"
        - subnet: "fd3a:138e:8fd0:0022::/64"
  nas:
    enable_ipv6: true
    ipam:
      config:
        - subnet: "172.23.0.0/16"
        - subnet: "fd3a:138e:8fd0:0023::/64"
services:
  website:
    restart: always
    build: website/.
    entrypoint: ["/bin/sh", "/home/me/entry.sh"]
    ports:
      - "80:8080"
      - "443:8443"
    networks:
      - web
    volumes:
      - ./website/certbot:/home/me/certbot
    cap_drop:
      - ALL
  gitea:
    restart: always
    image: gitea/gitea:latest-rootless
    user: "2000:2000"
    ports:
      - "2222:2222"
    networks:
      - web
    volumes:
      - ./website/gitea/data:/var/lib/gitea
      - ./website/gitea/config:/etc/gitea
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    cap_drop:
      - ALL
  monerod:
    restart: always
    build: monerod/.
    entrypoint: ["/bin/sh", "/home/me/entry.sh"]
    stdin_open: true
    tty: true
    ports:
      - "18080:18080"
      - "18081:18081"
    networks:
      - monero
    volumes:
      - ./monerod/.bitmonero:/home/me/.bitmonero
    cap_drop:
      - ALL
  p2pool:
    stop_grace_period: 1m # TODO reduce m_shutdownCountdown to reduce this
    restart: always
    build: p2pool/.
    entrypoint: ["/bin/sh", "/home/me/entry.sh"]
    stdin_open: true
    tty: true
    ports:
      - "3333:3333"
      - "37888:37888"
      - "37889:37889"
    networks:
      - monero
    volumes:
      - ./p2pool/cache:/home/me/cache
    cap_drop:
      - ALL
  minecraft:
    restart: always
    build: minecraft/.
    entrypoint: ["/bin/sh", "/home/me/entry.sh"]
    ports:
      - "25565:25565"
    networks:
      - game
    volumes:
      - ./minecraft/worlds:/home/me/worlds
    cap_drop:
      - ALL
  # minecraft_bedrock:
  #   restart: always
  #   build: minecraft_bedrock/.
  #   entrypoint: ["/bin/sh", "/home/me/entry.sh"]
  #   ports:
  #     - "19132:19132/udp"
  #     - "19133:19133/udp"
  #   networks:
  #     - game
  #   volumes:
  #     - ./minecraft_bedrock/worlds:/home/me/worlds
  #   cap_drop:
  #     - ALL
  terraria:
    restart: always
    build: terraria/.
    entrypoint: ["/bin/sh", "/home/me/entry.sh"]
    ports:
      - "7777:7777"
    networks:
      - game
    volumes:
      - ./terraria/worlds:/home/me/worlds
    cap_drop:
      - ALL
  nas:
    restart: always
    build: nas/.
    entrypoint: ["/bin/sh", "/home/me/entry.sh"]
    ports:
      - "445:8445"
    networks:
      - nas
    cap_drop:
      - ALL
