Docker workflow for DTaaS
This readme will explain the building and use of different docker files for use in development and installation of the DTaaS software.
NOTE: A local docker installation with compose plugin is a pre-requisite for using docker workflows.
Folder Structure
There are two dockerfiles for building the containers:
- client.dockerfile: Dockerfile for building the client application container.
- libms.dockerfile: Dockerfile for building the library microservice container from source code.
- libms.npm.dockerfile: Dockerfile for building the library microservice container from published npm package at npmjs.com. This Dockerfile is only used during publishing. It is used neither in the development builds nor in Github actions.
There is a specific compose file for development:
The compose.dev.yml: file is the docker compose file for development environment.
Build and Publish Docker Images
Project Managers
Build and publish the docker images. This step is required only for the publication of images to Docker Hub.
This publishing step is managed only by project managers. Regular developers can skip this step.
React Website
To tag version 0.3.1 for example, use
To test the react website container on localhost, please use
Library Microservice
The Dockerfile of library microservice has VERSION
argument.
This argument helps pick the right package version from http://npmjs.com.
To tag version 0.3.1 for example, use
To test the library microservice on localhost, please use
Developers
Use of docker images is handy for developers as well. It is suggested that developers build the required images locally on their computer and use them for development purposes. The images can be built using
Running Docker Containers
Follow these steps to use the application with docker.
The DTaaS application requires multiple configuration files. The list of configuration files to be modified are given for each scenario.
Development Environment
This scenario is for software developers.
The configuration files to be updated are:
- docker/.env : please see docker installation docs for help with updating this config file
- docker/conf.dev : please see docker installation docs for help with updating this config file
- client/config/local.js please see client config for help with updating this config file
- servers/lib/config/.env.default please see lib config for help with updating this config file
The docker commands need to be executed from this directory (docker
).
The relevant docker commands are:
Access the Application
You should access the application through the PORT mapped to the Traefik container.
e.g. localhost