The "trivial" solution is to iterate over the list finding the "lowest[1] number not yet stored in the output file", until you can't find a low number any longer. However, that will be tediously slow, since it probably means 1M reads of the entire unsorted file. But it won't take up much memory...
Unfortunately, any other method will involve reading the file (or some portions) into memory. On-disk sorting is a pretty rubbish method when there is enough memory to read into the memory - if you were to say sort a 40GB list of numbers on a machine with 16GB, then you have no choice, of course. But reading it all into memory and the writing it back out again is always the best choice if there is enough memory.
[1] Or highest, if you want to sort "high to low".