services:
  vpn:
    hostname: vpn
    build:
      context: .
      dockerfile: Dockerfile.vpn
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun
    restart: unless-stopped
    volumes:
      - ./config.ovpn:/etc/openvpn/config.ovpn
    networks:
      - vpn_net
    dns:
      - 1.1.1.1
      - 8.8.8.8

  owlrandomshitbot:
    image: owlrandomshitbot
    build:
      context: .
      dockerfile: Dockerfile.tgbot
    env_file: ".env"
    network_mode: "service:vpn"
    depends_on:
      - vpn

  booru-api:
    image: booru-api
    build:
      context: .
      dockerfile: Dockerfile.booru-api
    network_mode: "service:vpn"
    depends_on:
      - vpn

networks:
  vpn_net:
    driver: bridge
