# Deploy

You can deploy SenSeeAct to the server any time with these steps.

  • Make sure that you have the correct version of gradle.properties at:
    <GITDIR>/senseeact/ExampleSenSeeActService/gradle.properties

  • Open Terminal on your computer in:
    <GITDIR>/senseeact/ExampleSenSeeActService

  • Enter this command:

    > ./gradlew dockerBuild dockerStart
    

Like your local installation, you can use the following Gradle tasks:

  • 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 the following public URLs. Use your domain name instead of example.com.

  • https://www.example.com/servlets/senseeact/
    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).
    • Click Execute.

    You can also test sending mail:

    • Go to auth-controller > GET /auth/request-reset-password.
    • Click Try it out.
    • Enter the email address of your admin user.
    • Click Execute.
  • https://www.example.com/ or https://www.example.com/senseeact/
    SenSeeAct web application.

If you have set up SSH tunnels (Windows, Mac) for ports 10001 and 10002, you can also access the development tools.

  • http://localhost:10001/ (opens new window)
    phpMyAdmin. Here you can directly access the underlying MySQL 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.

# Logs

You can manage the Docker containers in a terminal on your server, in the same way as on your workstation (Windows, Mac). Below are the adapted instructions.

The SenSeeAct logs are written to the directory that you set in gradle.properties. If you followed our guide, that is /var/log/senseeact. You can copy log files from the server to your workstation (Windows, Mac) if you prefer to view them in your favourite text editor.

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 a terminal to your server (Windows, Mac).
  • 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
    f922daa72e72   senseeactweb
    
  • 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. This time you need to do it in two steps. First copy the files out of the Docker container to a directory on the server. Then download the files from the server to your workstation.

  • Open a terminal to your server (Windows, Mac).
  • Go to the directory on the server where you want to copy the files. For example senseeact in your home directory:
    $ mkdir -p ~/senseeact
    $ cd ~/senseeact
    
  • 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.
  • Finally download the files to your computer (Windows, Mac).

Useful logs:

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

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