Let me first point out that if you are uploading a file larger than 4MB, you need to use Upload large files with an upload session.. That said, the documentation you have mentioned says how uploading a file and for .docx file, Here is a curl sample that you can use with all headers and body well defined.
curl --location --request PUT 'https://graph.microsoft.com/v1.0/me/drive/root:/MyWordDoc.docx:/content' \
--header 'Content-Type: text/plain' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1...' \
--data-binary '@/C:/Path/File/Document.docx'
You may also find this guide on Upload large files using the Microsoft Graph SDKs helpful.