Could you elaborate on “This to minimize errors.”. It looks like you want to prevent users to change the schema, is that the case ? may be securing the DB with a security token (see https://dgraph.io/docs/deploy/dgraph-administration/#secure-alter-operations) is an option in your use case ?
You could then use the curl command with the correct token to set your schema in your docker file.