# Build and start

You can build and start SenSeeAct with these steps:

  • Make sure that Docker Desktop is started.

  • Open Terminal in:
    <GITDIR>\senseeact\ExampleSenSeeActService

  • Make sure that you have the correct version of gradle.properties.

  • Enter this command:

    > .\gradlew dockerBuild dockerStart
    

There are three Gradle tasks that you can use in that command:

  • dockerBuild:
    Builds the Docker images senseeacttomcat and senseeactweb.

  • dockerStart:
    Creates and starts the Docker containers, using docker compose up -d.

  • dockerStop:
    Stops and removes the Docker containers, using docker compose down.

# Test

When you have started SenSeeAct, you can try these URLs:

# Manage

Everything runs in a set of Docker containers, which are a sort of virtual machines. You can enter the containers to manage the software. This is in particular useful to check log files. You can also see some logs in Docker Desktop.

# Docker Desktop

When you open Docker Desktop, you see these items in the sidebar on the left:

  • Containers
    Click the name of a container to see some logs and other details.

    • senseeacttomcat
      Tomcat server containing the SenSeeAct web service and the Tomcat manager.

    • senseeactweb
      Apache server that contains the web application and serves as a proxy to the SenSeeAct web service in senseeacttomcat, and to phpmyadmin.

    • senseeactdb
      MariaDB server for the SenSeeAct database.

    • phpmyadmin
      Web tool to manage the MariaDB database.

  • Images
    Each container is based on an image, which contains the operating system, required software and provided application.

  • Volumes
    Volumes are used to store persistent data, in our case the MariaDB database, and to share data between containers.

# Logs

The SenSeeAct logs are written to the directory that you set in gradle.properties, property dockerLogDir. This means that the logs will be preserved when you restart the services and you can easily access them.

Other logs, such as general Apache and Tomcat access and error logs, are stored inside containers and they are not preserved across restarts.

# Enter a container

You can open a command shell in a container with these steps:

  • Open Terminal.
  • Run this command to list the running containers:
    > docker ps
    
    Each line starts with a container ID and image name, for example:
    CONTAINER ID   IMAGE
    e0922fa7d99f   senseeacttomcat:latest
    f922daa72e72   senseeactweb:latest
    
  • Copy the container ID and enter:
    > docker exec -it e0922fa7d99f bash
    
    Or if bash is not available in more minimal images such as senseeactweb:
    > docker exec -it f922daa72e72 sh
    

Now you can enter commands, for example to view log files.

# Copy files to your workstation

Instead of viewing log files in the shell, you can also copy them to your workstation, so you can view them in your favourite editor.

  • Open Terminal in the directory where you want to copy the files to.
  • Get the container ID in the same way as above.
  • Copy the files with a command like this:
    > docker cp e0922fa7d99f:/usr/local/tomcat/logs .
    
    Use the container ID and the path to the file or directory that you want to copy.

Useful logs:

  • senseeacttomcat
    General Tomcat logs in /usr/local/tomcat/logs

  • senseeactweb
    General Apache logs in /usr/local/apache2/logs