Deploying Gramps-Web on a Raspberry Pi 3 Model B+

Hi,

first I thought 1GB RAM of my system is not enough to run Gramps-Web, but I was able to run it nicely in my local network with two parameter changes (GUNICORN_NUM_WORKERS: 1; --concurrency=1)

Question: If I check the remaining free memory, it’s around 370 MB with no other big task running. Can you recommend more parameter changes in order to further reduce the needed memory? It would be nice to run Gramps-Web with low resources.
Here you can see the content of my docker-compose file:


services:
  grampsweb: &grampsweb
    image: ghcr.io/gramps-project/grampsweb:latest
    restart: alwaysHere you can see the content of my docker-compose file:
    ports:
      - "80:5000"  # host:docker
    environment:
      GRAMPSWEB_TREE: "Gramps Web"  # will create a new tree if not exists
      GRAMPSWEB_CELERY_CONFIG__broker_url: "redis://grampsweb_redis:6379/0"
      GRAMPSWEB_CELERY_CONFIG__result_backend: "redis://grampsweb_redis:6379/0"
      GRAMPSWEB_RATELIMIT_STORAGE_URI: redis://grampsweb_redis:6379/1
      GUNICORN_NUM_WORKERS: 1 # Added and set to 1 in order to save needed memory
    depends_on:
      - grampsweb_redis
    volumes:
      - gramps_users:/app/users  # persist user database
      - gramps_index:/app/indexdir  # persist search index
      - gramps_thumb_cache:/app/thumbnail_cache  # persist thumbnails
      - gramps_cache:/app/cache  # persist export and report caches
      - gramps_secret:/app/secret  # persist flask secret
      - gramps_db:/root/.gramps/grampsdb  # persist Gramps database
      - gramps_media:/app/media  # persist media files
      - gramps_tmp:/tmp

  grampsweb_celery:
    <<: *grampsweb  # YAML merge key copying the entire grampsweb service config
    ports: []
    container_name: grampsweb_celery
    depends_on:
      - grampsweb_redis
    command: celery -A gramps_webapi.celery worker --loglevel=INFO --concurrency=1 # Concurrency set to 1 in order to save needed memory

  grampsweb_redis:
    image: docker.io/library/redis:7.2.4-alpine
    container_name: grampsweb_redis
    restart: always

volumes:
  gramps_users:
  gramps_index:
  gramps_thumb_cache:
  gramps_cache:
  gramps_secret:
  gramps_db:
  gramps_media:
  gramps_tmp:

2 Likes

I wasn’t able so far to set up Gramps-Web via HTTPS with Let’s Encrypt. Under port 80 and 443 of my localhost, I can only see the nginx pages. And under gramps-example url outside my network even these nginx pages can’t be loaded. For port forwarding I followed these steps since it matches my setup: tutorials/dyndns-fuer-ipv6-server-hinter-fritzbox-konfigurieren

Question 2: Is there anything wrong with the HOST parameters, or am I missing something?
Question 3: Can you recommend how to debug in small steps? E.g. is there a simple tool/command to verify that ports 80 and 443 are reachable outside my network? At least I could successfully ping gramps-example.dynv6.net.

One error which appears is the following:#

nginx-proxy-acme  | Warning: /app/letsencrypt_service_data not found, skipping data from containers.
nginx-proxy-acme  | Sleep for 3600s
nginx-proxy-acme  | 2024/12/03 20:21:08 Generated '/app/letsencrypt_service_data' from 5 containers
nginx-proxy-acme  | 2024/12/03 20:21:08 Running '/app/signal_le_service'
nginx-proxy-acme  | 2024/12/03 20:21:08 Watching docker events
nginx-proxy-acme  | 2024/12/03 20:21:08 Contents of /app/letsencrypt_service_data did not change. Skipping notification '/app/signal_le_service'
nginx-proxy-acme  | [Tue Dec  3 20:21:10 UTC 2024] Account key creation OK.
nginx-proxy-acme  | [Tue Dec  3 20:21:11 UTC 2024] Registering account: https://acme-v02.api.letsencrypt.org/directory
nginx-proxy-acme  | [Tue Dec  3 20:21:22 UTC 2024] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 6

6 = Could not resolve host. The given remote host was not resolved.

Sometimes it also appears error code 7: Failed to connect() to host or proxy.

Here you can see the content of my docker-compose file:


services:
  grampsweb: &grampsweb
    container_name: grampsweb
    image: default # trying to remove links
    restart: always
    environment: &grampsweb-env
      GRAMPSWEB_TREE: "Gramps Web"  # will create a new tree if not exists
      VIRTUAL_PORT: "5000"
      VIRTUAL_HOST: gramps-example.dynv6  # e.g. gramps.mydomain | .com removed
      LETSENCRYPT_HOST: gramps-example.dynv6   # e.g. gramps.mydomain | .com removed
      LETSENCRYPT_EMAIL: mymail@example  # your email | .com removed
      GRAMPSWEB_CELERY_CONFIG__broker_url: "redis://grampsweb_redis:6379/0"
      GRAMPSWEB_CELERY_CONFIG__result_backend: "redis://grampsweb_redis:6379/0"
      GRAMPSWEB_RATELIMIT_STORAGE_URI: redis://grampsweb_redis:6379/1
      GUNICORN_NUM_WORKERS: 1 # Added and set to 1 in order to save needed memory
    volumes:
      - gramps_users:/app/users
      - gramps_index:/app/indexdir
      - gramps_thumb_cache:/app/thumbnail_cache
      - gramps_cache:/app/cache
      - gramps_secret:/app/secret
      - gramps_db:/root/.gramps/grampsdb
      - gramps_media:/app/media
      - gramps_tmp:/tmp
    networks:
      - proxy-tier
      - default
grampsweb_celery:
    <<: *grampsweb  # YAML merge key copying the entire grampsweb service config
    container_name: grampsweb_celery
    depends_on:
      - grampsweb_redis
    environment:
      <<: *grampsweb-env  # YAML merge key copying the grampsweb environment config
      # overriding let's encrypt variables since celery is not exposed
      VIRTUAL_PORT: ""
      VIRTUAL_HOST: ""
      LETSENCRYPT_HOST: ""
      LETSENCRYPT_EMAIL: ""
    command: celery -A gramps_webapi.celery worker --loglevel=INFO --concurrency=1

  grampsweb_redis:
    image: default # trying to remove links
    container_name: grampsweb_redis
    restart: always

  proxy:
    image: docker.io/nginxproxy/nginx-proxy
    container_name: nginx-proxy
    restart: always
    ports:
      - 80:80
      - 443:443
    environment:
      ENABLE_IPV6: "true"
    volumes:
      - ./nginx_proxy.conf:/etc/nginx/conf.d/my_proxy.conf:ro
      - conf:/etc/nginx/conf.d
      - dhparam:/etc/nginx/dhparam
      - certs:/etc/nginx/certs:ro
      - vhost.d:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - /var/run/docker.sock:/tmp/docker.sock:ro
    networks:
      - proxy-tier

  acme-companion:
    image: docker.io/nginxproxy/acme-companion
    container_name: nginx-proxy-acme
    restart: always
    environment:
      NGINX_PROXY_CONTAINER: nginx-proxy
    volumes:
      - certs:/etc/nginx/certs:rw
      - vhost.d:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - acme:/etc/acme.sh
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - proxy-tier
    depends_on:
      - proxy

volumes:
  acme:
  certs:
  conf:
  dhparam:
  vhost.d:
  html:
  gramps_users:
  gramps_index:
  gramps_thumb_cache:
  gramps_cache:
  gramps_secret:
  gramps_db:
  gramps_media:
  gramps_tmp:

networks:
  proxy-tier:
______________________________________________________________

Thank you very much for any help and advice.

Since it is after midnight there, I would not expect definitive response from David until tomorrow. But maybe some other users here are on Raspberry Pi.

(I hope to try that at some point in the future. So your experience is very interesting to me.)

1 Like

The only other thing that comes to mind is setting GUNICORN_NUM_WORKERS to 1, see Limit CPU & memory usage - Gramps Web.

Regarding your nginx/Let’s Enrypt issues - unfortunately I don’t know what this error means, but I suggest to ask here with a minimal example.