Not surprisingly, your Dr is correct.
Ribs (pretty much any bone...) typically take 6-8 weeks to heal.
Do not strap/tape the ribs. This is a purely Hollywood thing.
Because it hurts, people with rib injuries tend to take shallow breaths. This leads to fun things like pneumonia. So you need to be forcing yourself to breathe deeply, fully expanding the lungs, and cough. Hard. Yes, it will hurt. Do it anyway. You can support the ribs with a pillow while you're doing this. You need to be doing this at least every hour while you're awake.
Most of the pain from the injury is inflammation, so anti-inflammatories are your friend. Motrin or Naproxen would be my choice. Narcotics... meh. They may make you feel better, but they suppress the respiratory drive (see above about pneumonia). Maybe the first couple days, but after that I'd stay away from them.
You need to avoid impact injuries during that time, since those can shift the bone-ends. That can prevent union, and could injure the lung or other underlying structures. While unlikely, when these injuries do occur, they're potentially life threatening.
In 3-4 weeks you should be able to start increasing your activity level. Mild workouts will be fine, but exercise that puts a heavy strain on the chest muscles... not so much.