The dockerfilePath docs provide an example of using a file other than Dockerfile, but they don't specify what the path is resolved against.
It could be relative to the Root Directory setting:
Or it could be relative to the Railway Config File file setting:
There also doesn't seem to be a way to specify the docker build context. (build.context in docker-compose).