I could not find a docker-compose.yml example with rocket.chat using 4.2 so I pieced one together.
Also, some tips on these errors.
Error: $MONGO_OPLOG_URL must be set to the ‘local’ database of a Mongo replica set
MongoError: not master and slaveOk=false
Visit my Github repo for more information: https://github.com/xavier-hernandez/rocket.chat/