version: "3.8"

services:

  pocketbase:
    image: ghcr.io/coollabsio/pocketbase:latest
    environment:
      - SERVICE_FQDN_POCKETBASE_8080
    volumes:
      - ./pb/pocketbase-data:/app/pb_data
      - ./pb/pocketbase-hooks:/app/pb_hooks
    labels:
      - traefik.enable=true
      - traefik.http.routers.poketBaseTweb.rule=Host(`${POCKET_BASE_URL}`)
      - traefik.http.services.poketBaseTweb.loadbalancer.server.port=${POCKET_BASE_PORT}
      - traefik.http.routers.poketBaseTweb.tls.certresolver=le
    networks:
      - public

  front:
    image: git.lab-ouest.org/epitech/ratrapage_t-web_front:pr-16-head
    environment:
      - POCKETBASE_URL=https://${POCKET_BASE_URL}
    depends_on:
      - pocketbase
    labels:
      - traefik.enable=true
      - traefik.http.routers.astroTweb.rule=Host(`${FRONT_URL}`)
      - traefik.http.services.astroTweb.loadbalancer.server.port=${FRONT_BASE_PORT}
      - traefik.http.routers.astroTweb.tls.certresolver=le
    networks:
      - public

  back_drink:
    image: git.lab-ouest.org/epitech/ratrapage_t-web_back:master
    environment:
      - port=${BACK_BASE_PORT}
      - OPEN_TRIP_MAPS_KEY=${OPEN_TRIP_MAPS_KEY}
    labels:
      - traefik.enable=true
      - traefik.http.routers.expressDrinkTweb.rule=Host(`${DRINK_URL}`)
      - traefik.http.services.expressDrinkTweb.loadbalancer.server.port=${BACK_BASE_PORT}
      - traefik.http.routers.expressDrinkTweb.tls.certresolver=le
    networks:
      - public

  docs_drink:
    image: git.lab-ouest.org/epitech/ratrapage_t-web_drink_jsdocs:pr-6-head
    labels:
      - traefik.enable=true
      - traefik.http.routers.docsDrinkTweb.rule=Host(`${DOCS_DRINK_URL}`)
      - traefik.http.services.docsDrinkTweb.loadbalancer.server.port=${DOCS_BACK_BASE_PORT}
      - traefik.http.routers.docsDrinkTweb.tls.certresolver=le
    networks:
      - public


  blazegraph:
    image: conjecto/blazegraph:2.1.5
    # ports:
    #   - 9999:9999
    environment:
      JAVA_OPTS: -Xms6G -Xmx6G
    volumes:
      - ./datatourisme/dataset:/docker-entrypoint-initdb.d
    ulimits:
      nofile:
        soft: 65536
        hard: 65536
    networks:
      - graphQL
    restart: unless-stopped

  datatourisme:
    image: git.lab-ouest.org/epitech/fork-open-data-tourism:master
    depends_on:
      - blazegraph
    networks:
      - graphQL
      - public
    restart: unless-stopped
    labels:
      - traefik.enable=true
      - traefik.http.routers.dataTourisme.rule=Host(`${DATA_TOURISME_URL}`)
      - traefik.http.services.dataTourisme.loadbalancer.server.port=${DATA_TOURISME_BASE_PORT}
      - traefik.http.routers.dataTourisme.tls.certresolver=le

networks:
  graphQL: {}
  public:
    external: true
x-dockge:
  urls:
    - https://${POCKET_BASE_URL}/
    - https://${FRONT_URL}/
    - https://${DOCS_DRINK_URL}/
    - https://${DRINK_URL}/
    - https://${DATA_TOURISME_URL}/
