Grafana Docker and altered options.ts

I am adating options.ts to include timeframes with forecasts:

export const quickOptions: TimeOption[] = [
...
  { from: 'now-3h', to: 'now+90m', display: 'Last 3 hours & prediction' },
  { from: 'now-6h', to: 'now+90m', display: 'Last 6 hours & prediction' },
  { from: 'now-12h', to: 'now+90m', display: 'Last 12 hours & prediction' },
  { from: 'now-24h', to: 'now+90m', display: 'Last 24 hours & prediction' },
...

as I am running it in docker I am wondering what the file path to options.ts is so that I can mount it from the host system via docker-compose.yml

  grafana:
    image: grafana/grafana-oss:latest
    container_name: grafana
    restart: always
    depends_on:
      - influx
    volumes:
      - data-grafana:/var/lib/grafana
      - ./grafana/custom.ini:/etc/grafana/grafana.ini
      - ./grafana/options.ts:/etc/grafana/?????/?????/options.ts
    labels:
      - 'traefik.enable=true'
      - 'traefik.http.routers.grafana.rule=Host(`rcg-grafana.${NS_DOMAIN}`)'
      - 'traefik.http.routers.grafana.entrypoints=web'
      - 'traefik.http.routers.grafana.entrypoints=websecure'
      - 'traefik.http.routers.grafana.tls.certresolver=le'
    ports:
      - 3000:3000

Hi @mountrcg,

Welcome to the :grafana: community support forums !!

If I understand it correctly, basically you want to import (or better to say “provision”) some dashboards while installing Grafana with Docker?

# docker run --rm -ti --entrypoint bash grafana/grafana:9.3.2 -c "find / -name options.ts"
find: /proc/tty/driver: Permission denied
find: /root: Permission denied
/usr/share/grafana/public/app/plugins/panel/canvas/editor/options.ts

So there is no options.ts, because container contains “compiled” version. Your only option is to compile your own Grafana/Docker image with your customisation.

1 Like