Well, one way of making a vaccine is heat-killing bacteria and thus making them non-infectious.
One alternative to attenuated vaccines is a killed or inactivated vaccine. Vaccines of this type are created by inactivating a pathogen, typically using heat or chemicals such as formaldehyde or formalin. This destroys the pathogen’s ability to replicate, but keeps it “intact” so that the immune system can still recognize it.
Source
So that could work in your scenario. The time needed is difficult to guess - he'd probably want to make a culture from the blood of an infected person and use that for the heat treatment. That could take a few days for growing the bacteria. In a pinch, and with the right bacterium, and if everything works directly, a day or two could work.
Note that this is not really an estimate - this is the very best case scenario that is highly unlikely. But if people are dying around you, you are not going to do randomized, double-blind studies first. You're just going to take some victim's blood, get a bacterial culture going heat kill it and hope for the best in your first patients. Some or all might die. This might not work, etc.
It would help if your doctor carried some basic microbiology supplies - some Petri dishes or flasks and growth medium, for example. Some bacteria will grow a visible colony after a day, some after 5 to 7. Your doctor will have no idea what colony is from the bacterium he wants, and whether it even grew at all.
To get enough for all patients, he'll need to grow a lit of bacteria, because he has no idea how much he needs to stimulate an immune response. So depending on the size of that "town", this could take weeks to months.
Another good bet, though, are two other vaccine methods:
First, the way the tetanus vaccine is made, it's not against the bacteria, it's against its toxin. For example, you could have a bacterium that produces a toxin, that in very low doses and inactive can be given to someone to inoculate them.
This is how tetanus vaccine is made:
Toxigenic strains of C. tetani are grown in liquid media, the toxin is purified, and then inactivated by treatment with formaldehyde to produce the toxoid antigen.
WHO
The purification step is something your doctor really won't be able to reproduce, though. But heat-killing the bacteria in such a solution of bacteria and toxin might work for your disease.
Second, the smallpox way. Have another disease in your town that is similar to your deadly disease, but that people survive. The way that cowpox was a mild disease, but smallpox was a dangerous disease. Infect people with the less deadly disease to inoculate against the deadly one. You might have a story about the people who survive being from a different town where the had a childhood disease that now protects them etc. For smallpox, it was the milk maids who somehow didn't get smallpox because they had been exposed to cowpox.