Certified GKH Gardening Expert
You can grow phlox in pots, but it prefers full sun.
There are many phlox types, the perennial summer phlox, an annual summer phlox, plus a spring-blooming perennial creeping phlox. There also is a woodland phlox, which is most often found at native plant nurseries, that is at home in part shade areas or dappled shade. It blooms in spring.
You most likely are referring to the summer garden phlox. It gets tall, so use a tallish container.