TrueNAS Scale with Portainer for local-hosting Gramps-web

This is how I got Gramps-web running on my local TrueNAS Scale server.
Its essentially a workaround until we have a official TrueNAS or Truecharts app for Gramps.
I’m not that familiar with docker compose or kubernetes. But i found a guide how to use Portainer to make it work without having to build a custom kubernetes/helm chart. Thanks to Constantin.FF most of this guide is from his more general development purpose [Guide] Building and Running Custom Docker Applications on TrueNAS SCALE | TrueNAS Community

Prerequisites

  1. Have the TrueCharts apps catalog set up. Getting Started with TrueCharts | TrueCharts
  2. Create a dataset for Portainer in one off your pools (/mnt/pool-1/portainer/data).
  3. (Optional) If you plan to use your own domain for your apps (portainer.example.com, gramps.example.com)
    1. Install Traefik, cert-manager and clusterissuer, Installing Traefik | TrueCharts , clusterissuer Setup Guide | TrueCharts

Step 1: Installing Portainer

The default Portainer install only provides access to the Kubernetes cluster. To gain access to Docker as well, follow these steps:

  1. Mount the docker.sock into the container to access Docker directly
[Additional App Storage]
Type of Storage: Host Path
Host Path: /var/run/docker.sock
Mount Path: /var/run/docker.sock 
  1. Change “runAsGroup” to get access to docker
[Security Context]
runAsGroup: 999 (the "docker" group on SCALE).
  1. For proper project cloning and running in Portainer some additional settings are required.
    The actual discussion for this issue is here: https://github.com/orgs/portainer/discussions/9795
[Extra Args]
--data=/mnt/pool-1/portainer/data
[Additional App Storage]
Type of Storage: Host Path
Host Path: /mnt/pool-1/portainer/data
Mount Path: /mnt/pool-1/portainer/data

Step 2: Adding Docker Sock in Portainer

The default Portainer install only provides access to the Kubernetes cluster. To gain access to Docker as well, follow these steps:

  1. Log into the Portainer instance.
  2. Upon the first run, you’ll be prompted to add the “local” Kubernetes cluster. Proceed with it.
  3. Navigate to Environments+ Add Environment
  4. Choose Docker Standalone and select Start Wizard
  5. Select Socket, then provide a name for the environment.

Step 3: Adding Gramps-web stack in Portainer

  1. Fetch the latest docker-compose.yml from Deploy with Docker - Gramps Web
  2. From the Home screen, select your Docker environment.
  3. Access Stacks and click + Add Stack
  4. Choose Web editor and paste the contents of docker-compose.yml.
  5. Change the host ports from "80:5000" # host:docker to value that is not in use for something else in your Truenas. e.g "15570:5000" # host:docker
  6. Configure settings and environment variables based on your requirements. e.g. set GUNICORN_NUM_WORKERS: "2"
  7. Deploy the stack
  8. Test that its accessible on the ip address of your TrueNAS server e.g. http://192.168.1.2:15557

Step 4: (Optional) To access the Gramps-web via Traefik on your domain

The optional prerequisites are required. TrueNAS Web GUI via Traefik | TrueCharts

  1. Install external-service app
  2. Set External Service IP to the ip address of your TrueNAS server
  3. Set Port Type to HTTP
  4. Set Service Port to the same value as host ports in the Portainer stack Web editor in step 3 (default 80).
  5. Setup Ingress set the Host and HostName values to e.g. gramps.example.com and clusterIssuer

To do:

  1. Better storage of Gramps data its now stored in ix-applications/docker/volumes
3 Likes