Use LEADVIEW and Document Service with Docker Compose

This tutorial shows how to use a Docker Compose file to run LEADVIEW and the Document Service at the same time.

Overview  
Summary This tutorial covers how to use LEADVIEW and Document Service with Docker Compose.
Completion Time 30 minutes
Visual Studio Project Download tutorial project (130 MB)
Platform JavaScript Application using Docker
IDE Visual Studio 2017, 2019
Development License Download LEADTOOLS

Required Knowledge

Before working on the How to use LEADVIEW and Document Service with Docker Compose tutorial, complete the following tutorials:

In order to complete this project, you will need to install LEADTOOLS and Docker.

Create a Folder

The first step is to create a new folder. In that folder put the Document Service and the LEADVIEW Document Viewer.

New Folder containing LEADVIEW Document Viewer and Document Service

Create a Docker Compose File

The next step is to create a new file called docker-compose.yml. This file will contain all of the instructions that Docker needs to run the two projects. This requires that the two projects already have Docker files containing the instructions to build their own Docker image as covered in the Set up Document Service with Docker and Containerize LEADVIEW with Docker tutorials. Docker Compose allows you to run the two containers simultaneously.

Inside docker-compose.yml file add the following code:

version: "3" 
 
# Build services 
services: 
  # Name of container (must be lowercase) 
  document-service: 
    # File path to project 
    build: ./DocumentServiceDotNet 
    # Map container ports to localhost 
    ports: 
      - 30000:80 
 
  leadview-viewer: 
    build: ./LEADVIEW 
    ports: 
      - 5000:80 
    depends_on: 
      - document-service 

Build the Docker Containers

Once the docker-compose.yml file is complete, the containers are ready to be built. Open up the Terminal and navigate to the folder containing this project. Run the command:

docker-compose build

This will build both of the projects housed in this folder. Docker will look into both projects and build the containers using their Docker file instructions.

It may take a couple minutes for the project to complete building. Once it is complete the containers will be ready to run.

Run the Docker Containers

Once the Docker containers are ready to run, use the following command:

docker-compose up

You should see both containers running.

Terminal message confirming both LEADVIEW and Document Service are running

Visit http://localhost:30000 to see the Document Service.

Document Service Landing Page

Visit http://localhost:5000 to see LEADVIEW.

LEADVIEW

Wrap-up

In this tutorial, we covered how to run two Docker Containers simultaneously using Docker Compose. One container used the LEADTOOLS Document Service, and the other used the LEADVIEW Document Viewer.

See Also

Help Version 22.0.2024.3.20
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.