Group social dynamics don't work so easily. You probably think it's easy to tell 300 people vaguely to do a "bare minimum" amount of work, and then they flawlessly execute the spirit of your words; but in practice, hazy instructions like those still create a considerable amount traffic on the streets, queues at the gates, friends passing each other on the way to do each's "bare minimum" tasks and having a short chat together... and so, people will inadvertently spread the disease anyway, despite that you've gone to this extent in attempting prevention.
When working with large groups, you create a few simple blatant rules and enforce them. If we lock down the city, let's not do it incompetently as a half-measure, with a load of provisoes and conditional clauses that need to be determined. If someone is on the street without a wagon of grain or a wagon of charnel, we needn't get up in his face and ask twenty questions about his personal views of what constitutes bare minimums. He's breaking the curfew.
As for food shortages, we're a town, so I assume that we import most of our grain from the local countryside, anyway. What we're really doing is closing down the town market and telling any arriving farmers to go back to their hamlets and farmsteads. Same with sheep. They might be brought to market here, but our town's environs would be grazed out in mere days if the shepherds actually lived inside our town. The shepherds live itinerantly, driving their flocks out in the pastures. We simply tell them that we are not shearing sheep this month and send them away. Tey're probably safer that way, at any rate.