Skip to content

Scada LTS docker compose tutorial

Kamil Jarmusik edited this page Jan 2, 2023 · 5 revisions

Running Scada-LTS on Docker

  • IMPORTANT
    We do not recommend using docker in a production environment. However, if you decide to make docker save data permanently, you need to configure volumes: https://docs.docker.com/storage/volumes/

Docker installation

Docker installation is explained on the official Docker site. If you are a newbie to the Docker Environment we suggest to get acquainted with Getting started Guide. When everything is installed you can proceed.

Introduction to docker-compose

Docker Compose is a tool for running multi-container applications on Docker defined using the Compose file format. A Compose file is used to define how the one or more containers that make up your application are configured.
~Docker Compose GitHub

Inside docker-compose.yml file you will find the docker enviroment description to run Scada-LTS. There are two services defined: 'database' and 'scadalts'. If you have your containers running you can access to the as to classic docker containers using commands that are described in the Scada-LTS Docker Tutorial.

The first one is a MySQL database server service that is based on the official mysql-server:5.7 image with provided initial configuration like a database name and so on. It has exposed a port 3306 to the host machine so you can connect to it from your host machine using for example Workbench application.

Second is our Scada-LTS application container that was based on the Tomcat Image. We provide our Scada-LTS.war file to Tomcat /webapps directory and we set-up the configuration of server to run it. During the Scada-LTS docker image build process we paste the context XML file into Tomcat /config directory where we specify the database connection to database container. By default Scada-LTS has exposed port 8080 and 8000 to the host so you can access it from your host machine.

  • IMPORTANT
    You can change the database reference if you attach to running container with interactive shell. Just change the url parameter inside <Resource ...> xml tag. How to attach to running container see Attaching interactive shell section below.

Commands

Creating and starting containers

Using docker-compose you can start complete environment with all the services using just one command. But there is also a possibility to start just one service. To do that you can use the following commands that for example start just the database service:

docker-compose up database

Then you can run the second one with the application that will be running in the background:

docker-compose up -d scadalts

Show running containers

docker-compose ps

Stopping containers

To stop the scadalts container even if it is working in a background you can stop it with the following command:

docker-compose stop scadalts

Updating containers

For example a new version of Scada-LTS is available so you can update the container with the following command:

docker-compose pull

Removing containers

To clear your environment you can remove all the containers.

  • That will make that data stored inside database will be lost!
docker-compose down

Running Scada-LTS

Changing the scadalts tag inside docker-compose.yml file you can easly switch between different versions of Scada-LTS. Finally when server will be running the application should be available from any browser on following address:

localhost:8080/Scada-LTS

Stable version

By default in docker-compose.yml there is a reference to the scadalts/scadalts image with master tag in scadalts service. Master tag is the latest stable version of Scada-LTS. Stable varsions are that that was merged with master branch of our code.

Latest version

You can change that tag to latest to run the latest version of Scada-LTS based on the latest release version (eg. image: scadalts/scadalts:latest). Everytime the new release is published that image will be updated. But you have to run pull command to verify that the image is up-to-date.

Development version

There is an option to run any of avaialabe image of Scada-LTS but you have to find adequate tag on our DockerHub repository.

Access Serial Devices in Docker

Unix

I added device sharing for docker, only on unix system(macos x, linux):

devices:
   - "/dev/:/dev/"

Windows

Assuming there is a COM1 port, change if you have other ports:

devices:
   - "COM1:/dev/ttyS1"

See classic Docker approach tutorial.

Clone this wiki locally