Skip to content

Upgrade and maintain

Where: The server running your Docker Compose install
Who can use it: An IT admin with SSH access and sudo on the VM running Tursio

This page covers backing up, upgrading, and turning on HTTPS for a Docker Compose install of Tursio. You need the compose.yaml file path and any custom environment variables used at install time. For a first install, see Install Tursio.

Find the project name

Docker Compose names volumes and containers after its project name. The steps below use it as $project.

  1. Read the project name from the running containers. The nginx container is optional. If it isn't running, use the portal or database container.

    echo "NGINX (optional):"
    docker inspect $(docker ps -qf "name=tursio-singleportal-nginx") \
      --format '{{ index .Config.Labels "com.docker.compose.project" }}'
    
    echo "PORTAL:"
    docker inspect $(docker ps -qf "name=tursio-singleportal-portal") \
      --format '{{ index .Config.Labels "com.docker.compose.project" }}'
    
    echo "DATABASE:"
    docker inspect $(docker ps -qf "name=tursio-singleportal-database") \
      --format '{{ index .Config.Labels "com.docker.compose.project" }}'
    
  2. Check that all values are the same.

  3. Set the variable in your shell:

    project=<project-name>
    

Back up and restore

Back up before every upgrade. Your data lives in two Docker volumes: tursio-singleportal-database-volume (PostgreSQL) and tursio-data (Tursio's files). The backup stops Tursio for a short time.

  1. Stop the portal and the database so the backup is consistent:

    docker compose -p $project stop tursio-singleportal-portal tursio-singleportal-database
    
  2. Back up the internal PostgreSQL volume:

    docker run --rm \
      -v ${project}_tursio-singleportal-database-volume:/data \
      -v $(pwd):/backup \
      busybox tar -czvf /backup/db_backup_$(date +%F).tar.gz -C /data .
    
  3. Back up the portal file storage:

    docker run --rm \
      -v ${project}_tursio-data:/data \
      -v $(pwd):/backup \
      busybox tar -czvf /backup/portal_backup_$(date +%F).tar.gz -C /data .
    
  4. Start the services again:

    docker compose -p $project start tursio-singleportal-database tursio-singleportal-portal
    
  5. Check the backup files:

    tar -tvf db_backup_*.tar.gz | head
    tar -tvf portal_backup_*.tar.gz | head
    
Restore from a backup

Run these from the folder that holds the backup files. Replace <date> with the date in the file names.

docker compose -p $project stop

docker run --rm \
  -v ${project}_tursio-singleportal-database-volume:/restore \
  -v $(pwd):/backup \
  busybox tar -xzvf /backup/db_backup_<date>.tar.gz -C /restore

docker run --rm \
  -v ${project}_tursio-data:/restore \
  -v $(pwd):/backup \
  busybox tar -xzvf /backup/portal_backup_<date>.tar.gz -C /restore

docker compose -p $project start

Deploy a new image

Tursio sends you a text file with a download link for the new image tarball, for example tursio-v0.1.0-myaccount-20251112.tar.gz. The link is valid for 12 hours.

  1. Download the image tarball with the link.
  2. Load the image:

    docker load -i tursio-v0.1.0-myaccount-20251112.tar.gz
    
  3. Find the image name and tag with docker image ls.

  4. Update compose.yaml. Set the image: field of both tursio-singleportal-data-init and tursio-singleportal-portal to the new image name and tag.
  5. Start the new image from the folder that holds compose.yaml:

    docker compose -p $project up -d tursio-singleportal-data-init tursio-singleportal-portal
    

    The init container runs again. It adds new starter files to the tursio-data volume without overwriting your files, and refreshes config.ini (it keeps a dated backup of the old one). The portal starts when it finishes.

  6. Check that the new image is running with docker ps.

Enable HTTPS

This section applies only if you haven't set up HTTPS before.

nginx turns on HTTPS by itself when it finds a valid certificate and private key. With HTTPS on, it redirects port 80 to 443. Without them, it serves HTTP only.

  1. Get the certificate and key files (cert.pem and key.pem) for your organization.
  2. Point the environment variables at the files. Use full paths:

    export UI_CERT_FILE=/path/to/cert.pem
    export UI_KEY_FILE=/path/to/key.pem
    
  3. Apply the new configuration from the folder that holds compose.yaml:

    docker compose -p $project up -d
    
  4. Open the portal at https://<vm-address>.

Increase the timeout

nginx waits up to 900 seconds for the portal. To change that, edit the nginx templates next to compose.yaml. nginx copies one of them into place each time it starts: tursio-nginx-https.conf with HTTPS, tursio-nginx-http.conf without.

  1. Edit the timeout values inside the location / block of both templates:

    proxy_read_timeout 900s;
    proxy_connect_timeout 900s;
    proxy_send_timeout 900s;
    
  2. Restart nginx to apply the change:

    docker compose -p $project restart tursio-singleportal-nginx
    
  3. Check the values nginx uses:

    docker exec tursio-singleportal-nginx nginx -T | grep timeout
    

Tips and limits

  • Set the HTTPS variables every time. docker compose reads UI_CERT_FILE and UI_KEY_FILE from your shell each time it creates the nginx container. If they are missing, nginx falls back to HTTP. To keep them, put them in a .env file next to compose.yaml.