Align GrampsWeb setup with official docker-compose (STI-91)
Some checks are pending
CI/CD Pipeline / test (push) Waiting to run
CI/CD Pipeline / deploy (push) Blocked by required conditions
Code Quality / quality (push) Waiting to run

Replace custom GrampsWeb config with the official setup:
- Use YAML anchor (&grampsweb / <<: *grampsweb) for DRY config
- Add all 8 official volumes: users, indexdir, thumbnail_cache, cache,
  secret, grampsdb, media, tmp
- Remove custom admin creation command (use GrampsWeb's built-in flow)
- Remove GRAMPSWEB_SECRET_KEY (managed by gramps_secret volume)
- Celery worker inherits full config via YAML merge
- Shared /tmp volume between web and celery for file transfers

Previous setup only had 2 volumes (data, cache), causing data loss
on container restart and GEDCOM import failures.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
SysAdmin Agent
2026-04-05 19:58:08 +00:00
parent 1254ec46d0
commit ebf7ec2d9e
2 changed files with 25 additions and 56 deletions

View File

@@ -188,73 +188,45 @@ services:
wait $$OLLAMA_PID
"
grampsweb:
grampsweb: &grampsweb
image: ghcr.io/gramps-project/grampsweb:latest
restart: unless-stopped
ports:
- "8090:5000"
environment:
- GRAMPSWEB_SECRET_KEY=${GRAMPSWEB_SECRET_KEY:-dev-grampsweb-secret-key-not-for-production}
- GRAMPSWEB_ADMIN_EMAIL=${GRAMPSWEB_ADMIN_EMAIL:-admin@localhost}
- GRAMPSWEB_ADMIN_PASSWORD=${GRAMPSWEB_ADMIN_PASSWORD:-gramps_dev_password}
- GRAMPSWEB_TREE=${GRAMPSWEB_TREE:-Stiftung}
- GRAMPSWEB_BASE_URL=${GRAMPSWEB_BASE_URL:-https://ahnenforschung.vhtv-stiftung.de}
- GRAMPSWEB_CELERY_CONFIG__broker_url=redis://redis:6379/0
- GRAMPSWEB_CELERY_CONFIG__result_backend=redis://redis:6379/0
- GRAMPSWEB_RATELIMIT_STORAGE_URI=redis://redis:6379/1
- GRAMPSWEB_NEW_DB_BACKEND=sqlite
command:
- sh
- -c
- |
# GrampsWeb runs on its own subdomain — no subpath rewriting needed.
echo "[grampsweb] Ensuring admin user exists ..."
python3 << 'PYEOF' 2>&1 | grep -v Gtk
from gramps_webapi.app import create_app
from gramps_webapi.auth import add_user, get_number_users, ROLE_OWNER
import os
email = os.environ.get('GRAMPSWEB_ADMIN_EMAIL', '')
pw = os.environ.get('GRAMPSWEB_ADMIN_PASSWORD', '')
if email and pw:
app = create_app()
with app.app_context():
if get_number_users() == 0:
add_user(name='Admin', email=email, password=pw, role=ROLE_OWNER)
print('[grampsweb] Admin user created')
else:
print('[grampsweb] Users already exist, skipping')
else:
print('[grampsweb] No admin credentials configured, skipping')
PYEOF
exec gunicorn -w $${GUNICORN_NUM_WORKERS:-8} -b 0.0.0.0:5000 \
gramps_webapi.wsgi:app --timeout $${GUNICORN_TIMEOUT:-120} \
--limit-request-line 8190
GRAMPSWEB_TREE: ${GRAMPSWEB_TREE:-Stiftung}
GRAMPSWEB_CELERY_CONFIG__broker_url: "redis://redis:6379/0"
GRAMPSWEB_CELERY_CONFIG__result_backend: "redis://redis:6379/0"
GRAMPSWEB_RATELIMIT_STORAGE_URI: "redis://redis:6379/1"
GRAMPSWEB_BASE_URL: ${GRAMPSWEB_BASE_URL:-https://ahnenforschung.vhtv-stiftung.de}
volumes:
- gramps_data:/app/data
- 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
depends_on:
- db
- redis
grampsweb_celery:
image: ghcr.io/gramps-project/grampsweb:latest
restart: unless-stopped
environment:
- GRAMPSWEB_SECRET_KEY=${GRAMPSWEB_SECRET_KEY:-dev-grampsweb-secret-key-not-for-production}
- GRAMPSWEB_TREE=${GRAMPSWEB_TREE:-Stiftung}
- GRAMPSWEB_BASE_URL=${GRAMPSWEB_BASE_URL:-https://ahnenforschung.vhtv-stiftung.de}
- GRAMPSWEB_CELERY_CONFIG__broker_url=redis://redis:6379/0
- GRAMPSWEB_CELERY_CONFIG__result_backend=redis://redis:6379/0
- GRAMPSWEB_NEW_DB_BACKEND=sqlite
command: celery -A gramps_webapi.celery worker --loglevel=info
volumes:
- gramps_data:/app/data
- gramps_cache:/app/cache
<<: *grampsweb
ports: []
depends_on:
- grampsweb
- redis
command: celery -A gramps_webapi.celery worker --loglevel=INFO --concurrency=2
volumes:
dbdata:
gramps_data:
gramps_users:
gramps_index:
gramps_thumb_cache:
gramps_cache:
gramps_secret:
gramps_db:
gramps_media:
gramps_tmp:
ollama_data: