How to do it

We proceed with the recipe as follows:

  1. Docker Compose uses a docker-compose.yml file that tells Docker how to compose containers as services.  In the 10/05 folder there is a docker-compose.yml file to start up all the parts of our scraper as a service.  The following is the file's contents:
version: '3'services:  api:    image: scraper-rest-api    ports:      - "8080:8080"    networks:      - scraper-compose-net  scraper:    image: scraping-microservice    depends_on:      - rabbitmq    networks:      - scraper-compose-net  elastic:    image:    ports:      - "9200:9200"      - "9300:9300"    networks:      - scraper-compose-net  rabbitmq:    image: rabbitmq:3-management    ports:      - "15672:15672"    networks:      - scraper-compose-netnetworks: scraper-compose-net: ...

Get Python Web Scraping Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.