Tomatoes like HOT, full sun all day no shade, and lots of room for roots. They're also sneaky lying #$&*, lol. They will sprout anywhere... fruiting is totally different..
Common problems are:
Crowding. 1 plant per 5 gallon minimum size container. Healthy tomato plants ready to give you tomatoes, especially indeterminate varieties, are huge. 10ft tall and 3ft wide in their cages.
Cool temps, Even one night in the 50s can stunt them, and they may never recover in time to produce fruit.
Less than full direct sun All day
Nothing is more disappointing than spending an entire summer trying to coax 3-4 anemic fruits off a plant you've babied for months. If you don't have the sun, heat and root space it's going to be disappointing.
You can purchase determinate varieties that are made specifically for containers that May produce better outcomes,
Speaking of which, there is a very entertaining book I believe it's called the $64 tomato.. it's a great read and you'll feel much better after reading it.