GitLab CI - Only Changes and Only Branches (refs)

Hi, I am trying to setup GitLab CI to run job only when branch is master or develop AND there are changes to my Dockerfile.

I have tried this:
only:
refs:
- master
- develop
changes:
- Dockerfile

It doesn’t work. Any ideas?