Polish Sauerkraut Soup

2 tablespoons sunflower oil
1 large onion, diced
1 medium leek, white and light green parts only, finely sliced
1 medium carrot, diced
1 medium parsnip, diced
2 large garlic cloves, finely chopped
1/2 teaspoon caraway seeds
1 teaspoon dried marjoram
1 teaspoon allspice
6-8 juniper berries
2-3 bay leaves
400 g (1 lb) sauerkraut, drained
3 potatoes, peeled and cut into 1-inch cubes (about 500 g)
1.5 litres (6 cups) vegetable stock
Salt and freshly ground pepper to taste