Deploying WDS API Server in Docker Compose

This deployment type is the easiest and recommended for evaluation and development environments. It’s proposed to be run on the local machine together with a database so the API Server will be bound to the local port 2807 and be accessible on the URL http://localhost:2807.

To make use of this deployment type, docker-compose needs to be installed locally. Use the following command to check if it’s already installed:

docker compose version

the result should be like this:

Docker Compose version <version>

If the result shows that docker-compose is not installed, please review the installation documentation on its official website

Deployment Options

Taking into account that the API Server requires third-party components, there are several deployment options:

This deployment option implies connecting to an external MongoDB. For evaluation purposes, a Free MongoDB Atlas cluster can be used.
In the wds.solidstack service replace the value of the DB_CONNECTION_STRING environment variable with a real connection string to a MongoDB database.

IMPORTANT! MongoDB connection string must contain a database name. It might be Solidstack as in the example connection string or anything else.

services:  
  wds.solidstack:
    image: docker.io/webdatasource/solidstack:v1.0.0
    restart: always
    hostname: solidstack.svc
    environment:
      - EXTERNAL_IP_ADDRESS_CONFIGS=intranet
      - JOBS_TYPES=intranet
      - DB_CONNECTION_STRING=mongodb+srv://<user>:<password>@<host>/Solidstack?appName=<cluster>&readPreference=secondary
    ports:
      - 2807:8081
  
  wds.playground:
    image: docker.io/webdatasource/playground:v1.0.0
    restart: always
    hostname: playground.svc
    ports:
    - 2808:80
  
  wds.docs:
    image: docker.io/webdatasource/docs:v1.0.2
    restart: always
    ports:
    - 2809:80
This deployment option implies connecting to an external MongoDB. For evaluation purposes, a Free MongoDB Atlas cluster can be used.
In the wds.dapi, wds.datakeeper, and wds.idealer services replace values of the DB_CONNECTION_STRING environment variables with real connection strings to a MongoDB database.

By default, system DB (MongoDB) is used to cache web pages. This behavior can be changed by providing the wds.datakeeper service with a CACHE_CONNECTION_STRING.

IMPORTANT! MongoDB connection strings must contain a database name. The names might be the same as values in the example connection strings or others.

services: 
  wds.crawler:
    image: docker.io/webdatasource/crawler:v1.0.0
    restart: always
    hostname: crawler.svc
    environment:
      - DATAKEEPER_ORIGIN=http://datakeeper.svc
      - SERVICE_HOST=crawler.svc
      - EXTERNAL_IP_ADDRESS_CONFIGS=intranet
  
  wds.datakeeper:
    image: docker.io/webdatasource/datakeeper:v1.0.0
    restart: always
    hostname: datakeeper.svc
    environment:
      - DB_CONNECTION_STRING=mongodb+srv://<user>:<password>@<host>/Datakeeper?appName=<cluster>&readPreference=secondary
      - IDEALER_ORIGIN=http://idealer.svc

  wds.idealer:
    image: docker.io/webdatasource/idealer:v1.0.0
    restart: always
    hostname: idealer.svc
    environment:
      - DB_CONNECTION_STRING=mongodb+srv://<user>:<password>@<host>/Idealer?appName=<cluster>&readPreference=secondary
  
  wds.scraper:
    image: docker.io/webdatasource/scraper:v1.0.0
    restart: always
    hostname: scraper.svc
  
  wds.dapi:
    image: docker.io/webdatasource/dapi:v1.0.0
    restart: always
    hostname: dapi.svc
    environment:
      - DB_CONNECTION_STRING=mongodb+srv://<user>:<password>@<host>/Dapi?appName=<cluster>&readPreference=secondary
      - DATAKEEPER_ORIGIN=http://datakeeper.svc
      - SCRAPER_ORIGIN=http://scraper.svc
      - IDEALER_ORIGIN=http://idealer.svc
      - JOBS_TYPES=intranet
    ports:
      - 2807:8081
  
  wds.playground:
    image: docker.io/webdatasource/playground:v1.0.0
    restart: always
    hostname: playground.svc
    ports:
    - 2808:80
  
  wds.docs:
    image: docker.io/webdatasource/docs:v1.0.2
    restart: always
    ports:
    - 2809:80
This deployment option contains all third-party services for system evaluation, even in an air-gapped environment. There is only one instance per service, and credentials are not protected since this is an evaluation environment.

services:
  mongodb-primary:
    image: docker.io/zcube/bitnami-compat-mongodb:6.0
    restart: always
    hostname: mongodb-primary.svc
    environment:
      - MONGODB_ADVERTISED_HOSTNAME=mongodb-primary.svc
      - MONGODB_ROOT_USER=root
      - MONGODB_ROOT_PASSWORD=TestPassword
      - MONGODB_REPLICA_SET_MODE=primary
      - MONGODB_REPLICA_SET_KEY=TestReplicasetKey
  
  mongodb-secondary:
    image: docker.io/zcube/bitnami-compat-mongodb:6.0
    restart: always
    hostname: mongodb-secondary.svc
    depends_on:
      - mongodb-primary
    environment:
      - MONGODB_ADVERTISED_HOSTNAME=mongodb-secondary.svc
      - MONGODB_REPLICA_SET_MODE=secondary
      - MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary.svc
      - MONGODB_REPLICA_SET_KEY=TestReplicasetKey
      - MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=TestPassword

  mongodb-arbiter:
    image: docker.io/zcube/bitnami-compat-mongodb:6.0
    restart: always
    hostname: mongodb-arbiter.svc
    depends_on:
      - mongodb-primary
    environment:
      - MONGODB_ADVERTISED_HOSTNAME=mongodb-arbiter.svc
      - MONGODB_REPLICA_SET_MODE=arbiter
      - MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary.svc
      - MONGODB_REPLICA_SET_KEY=TestReplicasetKey
      - MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=TestPassword
  
  minio:
    image: docker.io/bitnami/minio:2024
    restart: always
    hostname: minio.svc
    environment:
      - MINIO_DEFAULT_BUCKETS=pages-cache
      - MINIO_ROOT_USER=TestAccessKey
      - MINIO_ROOT_PASSWORD=TestSecretKey
      - MINIO_FORCE_NEW_KEYS=no
 
  wds.crawler:
    image: docker.io/webdatasource/crawler:v1.0.0
    restart: always
    hostname: crawler.svc
    environment:
      - DATAKEEPER_ORIGIN=http://datakeeper.svc
      - SERVICE_HOST=crawler.svc
      - EXTERNAL_IP_ADDRESS_CONFIGS=intranet
  
  wds.datakeeper:
    image: docker.io/webdatasource/datakeeper:v1.0.0
    restart: always
    hostname: datakeeper.svc
    environment:
      - DB_CONNECTION_STRING=mongodb://root:TestPassword@mongodb-primary.svc,mongodb-secondary.svc/Datakeeper?authSource=admin&replicaSet=replicaset&readPreference=secondary
      - CACHE_CONNECTION_STRING=s3://TestAccessKey:TestSecretKey@minio.svc:9000/pages-cache?ssl=false
      - IDEALER_ORIGIN=http://idealer.svc

  wds.idealer:
    image: docker.io/webdatasource/idealer:v1.0.0
    restart: always
    hostname: idealer.svc
    environment:
      - DB_CONNECTION_STRING=mongodb://root:TestPassword@mongodb-primary.svc,mongodb-secondary.svc/Idealer?authSource=admin&replicaSet=replicaset&readPreference=secondary
  
  wds.scraper:
    image: docker.io/webdatasource/scraper:v1.0.0
    restart: always
    hostname: scraper.svc
  
  wds.dapi:
    image: docker.io/webdatasource/dapi:v1.0.0
    restart: always
    hostname: dapi.svc
    environment:
      - DB_CONNECTION_STRING=mongodb://root:TestPassword@mongodb-primary.svc,mongodb-secondary.svc/Dapi?authSource=admin&replicaSet=replicaset&readPreference=secondary
      - DATAKEEPER_ORIGIN=http://datakeeper.svc
      - SCRAPER_ORIGIN=http://scraper.svc
      - IDEALER_ORIGIN=http://idealer.svc
      - JOBS_TYPES=intranet
    ports:
      - 2807:8081
  
  wds.playground:
    image: docker.io/webdatasource/playground:v1.0.0
    restart: always
    hostname: playground.svc
    ports:
    - 2808:80
  
  wds.docs:
    image: docker.io/webdatasource/docs:v1.0.2
    restart: always
    ports:
    - 2809:80

Running Docker Compose

After an appropriate deployment option is selected and a docker-compose configuration has been copied to a file (e.g., wds-docker-compose.yml), there are two types of scripts to run docker-compose:

set COMPOSE_FILE=wds-docker-compose.yml && docker compose up
export COMPOSE_FILE=wds-docker-compose.yml && docker compose up

Please rotate your device to landscape mode

This documentation is specifically designed with a wider layout to provide a better reading experience for code examples, tables, and diagrams.
Rotating your device horizontally ensures you can see everything clearly without excessive scrolling or resizing.

Return to Web Data Source Home