Align GrampsWeb setup with official docker-compose (STI-91)
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:
76
compose.yml
76
compose.yml
@@ -188,73 +188,45 @@ services:
|
|||||||
wait $$OLLAMA_PID
|
wait $$OLLAMA_PID
|
||||||
"
|
"
|
||||||
|
|
||||||
grampsweb:
|
grampsweb: &grampsweb
|
||||||
image: ghcr.io/gramps-project/grampsweb:latest
|
image: ghcr.io/gramps-project/grampsweb:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "8090:5000"
|
- "8090:5000"
|
||||||
environment:
|
environment:
|
||||||
- GRAMPSWEB_SECRET_KEY=${GRAMPSWEB_SECRET_KEY:-dev-grampsweb-secret-key-not-for-production}
|
GRAMPSWEB_TREE: ${GRAMPSWEB_TREE:-Stiftung}
|
||||||
- GRAMPSWEB_ADMIN_EMAIL=${GRAMPSWEB_ADMIN_EMAIL:-admin@localhost}
|
GRAMPSWEB_CELERY_CONFIG__broker_url: "redis://redis:6379/0"
|
||||||
- GRAMPSWEB_ADMIN_PASSWORD=${GRAMPSWEB_ADMIN_PASSWORD:-gramps_dev_password}
|
GRAMPSWEB_CELERY_CONFIG__result_backend: "redis://redis:6379/0"
|
||||||
- GRAMPSWEB_TREE=${GRAMPSWEB_TREE:-Stiftung}
|
GRAMPSWEB_RATELIMIT_STORAGE_URI: "redis://redis:6379/1"
|
||||||
- GRAMPSWEB_BASE_URL=${GRAMPSWEB_BASE_URL:-https://ahnenforschung.vhtv-stiftung.de}
|
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
|
|
||||||
volumes:
|
volumes:
|
||||||
- gramps_data:/app/data
|
- gramps_users:/app/users
|
||||||
|
- gramps_index:/app/indexdir
|
||||||
|
- gramps_thumb_cache:/app/thumbnail_cache
|
||||||
- gramps_cache:/app/cache
|
- gramps_cache:/app/cache
|
||||||
|
- gramps_secret:/app/secret
|
||||||
|
- gramps_db:/root/.gramps/grampsdb
|
||||||
|
- gramps_media:/app/media
|
||||||
|
- gramps_tmp:/tmp
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
|
||||||
- redis
|
- redis
|
||||||
|
|
||||||
grampsweb_celery:
|
grampsweb_celery:
|
||||||
image: ghcr.io/gramps-project/grampsweb:latest
|
<<: *grampsweb
|
||||||
restart: unless-stopped
|
ports: []
|
||||||
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
|
|
||||||
depends_on:
|
depends_on:
|
||||||
|
- grampsweb
|
||||||
- redis
|
- redis
|
||||||
|
command: celery -A gramps_webapi.celery worker --loglevel=INFO --concurrency=2
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
dbdata:
|
dbdata:
|
||||||
gramps_data:
|
gramps_users:
|
||||||
|
gramps_index:
|
||||||
|
gramps_thumb_cache:
|
||||||
gramps_cache:
|
gramps_cache:
|
||||||
|
gramps_secret:
|
||||||
|
gramps_db:
|
||||||
|
gramps_media:
|
||||||
|
gramps_tmp:
|
||||||
ollama_data:
|
ollama_data:
|
||||||
|
|||||||
@@ -59,10 +59,7 @@ GRAMPS_USERNAME=Stiftung
|
|||||||
GRAMPS_PASSWORD=your-gramps-password-here
|
GRAMPS_PASSWORD=your-gramps-password-here
|
||||||
GRAMPS_API_TOKEN=
|
GRAMPS_API_TOKEN=
|
||||||
|
|
||||||
# GrampsWeb Container Konfiguration
|
# GrampsWeb Container Konfiguration (aligned with official docker-compose)
|
||||||
GRAMPSWEB_SECRET_KEY=your-grampsweb-secret-key-here
|
|
||||||
GRAMPSWEB_ADMIN_EMAIL=admin@vhtv-stiftung.de
|
|
||||||
GRAMPSWEB_ADMIN_PASSWORD=your-grampsweb-admin-password-here
|
|
||||||
GRAMPSWEB_TREE=Stiftung
|
GRAMPSWEB_TREE=Stiftung
|
||||||
# Full external URL (used by GrampsWeb for email links, OIDC, etc.)
|
# Full external URL (used by GrampsWeb for email links, OIDC, etc.)
|
||||||
GRAMPSWEB_BASE_URL=https://ahnenforschung.vhtv-stiftung.de
|
GRAMPSWEB_BASE_URL=https://ahnenforschung.vhtv-stiftung.de
|
||||||
|
|||||||
Reference in New Issue
Block a user