version: '3.8'

networks:
  traefik-public:
    external: true
  smartcity-shared:
    external: true

services:
  cratedb:
    container_name: smart-city-cratedb
    image: crate:5.5
    restart: unless-stopped
    environment:
      - CRATE_HEAP_SIZE=1g
    volumes:
      - cratedb-data:/data
    networks:
      - smartcity-shared
    ports:
      - "4200:4200"
      - "5432:5432"

  quantumleap:
    container_name: smart-city-quantumleap
    image: fiware/quantum-leap:latest
    restart: unless-stopped
    environment:
      - CRATE_HOST=smart-city-cratedb
      - CRATE_PORT=4200
      - CRATE_DB_NAME=quantumleap
      - QL_LOG_LEVEL=INFO
    depends_on:
      - cratedb
    networks:
      - smartcity-shared
      - traefik-public
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.quantumleap.rule=Host(`quantum-leap.digitribe.fr`)"
      - "traefik.http.routers.quantumleap.entrypoints=websecure"
      - "traefik.http.routers.quantumleap.tls=true"
      - "traefik.http.services.quantumleap.loadbalancer.server.port=8668"

volumes:
  cratedb-data:
