# 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 imagessenseeacttomcat
andsenseeactweb
.dockerStart
:
Creates and starts the Docker containers, usingdocker compose up -d
.dockerStop
:
Stops and removes the Docker containers, usingdocker compose down
.
# Test
When you have started SenSeeAct, you can try these URLs:
http://localhost:10000/servlets/senseeact/ (opens new window)
Swagger UI where you can try the endpoints of the SenSeeAct API. For example you can try to log in as the SenSeeAct admin user that you configured:- Go to auth-controller > POST /auth/login.
- Click Try it out.
- Fill in the email and password of your admin user (note: the password is not hidden here).
- Click Execute.
http://localhost:10000/senseeact/ (opens new window)
SenSeeAct web application.http://localhost:10001/ (opens new window)
phpMyAdmin. Here you can directly access the underlying MariaDB database, which runs at port 10004. Log in with username “root” and the password that you configured.http://localhost:10002/ (opens new window)
Tomcat manager. Here you can see the Tomcat status, and start, stop or reload the SenSeeAct web service:- Click Manager App.
- Log in with the username and password of the Tomcat user that you configured.
# 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:Each line starts with a container ID and image name, for example:
> docker ps
CONTAINER ID IMAGE e0922fa7d99f senseeacttomcat:latest f922daa72e72 senseeactweb:latest
- Copy the container ID and enter:Or if
> docker exec -it e0922fa7d99f bash
bash
is not available in more minimal images such assenseeactweb
:> 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:Use the container ID and the path to the file or directory that you want to copy.
> docker cp e0922fa7d99f:/usr/local/tomcat/logs .
Useful logs:
senseeacttomcat
General Tomcat logs in/usr/local/tomcat/logs
senseeactweb
General Apache logs in/usr/local/apache2/logs