|
| 1 | +FROM mcr.microsoft.com/devcontainers/python:3.11 |
| 2 | + |
| 3 | + |
| 4 | +RUN apt-get update && apt-get install -y \ |
| 5 | + gettext appstream pkg-config libcairo2-dev gir1.2-gtk-3.0 \ |
| 6 | + libgirepository1.0-dev libicu-dev libopencv-dev tesseract-ocr \ |
| 7 | + tesseract-ocr-all gir1.2-pango-1.0 \ |
| 8 | + && rm -rf /var/lib/apt/lists/* |
| 9 | + |
| 10 | +RUN pip install opencv-python |
| 11 | +RUN pip install gramps==6.0.1 |
| 12 | + |
| 13 | +ENV LANGUAGE=en |
| 14 | +ENV OMP_NUM_THREADS=1 |
| 15 | +ENV GRAMPSWEB_USER_DB_URI=sqlite:////workspaces/web-api/data/users.sqlite |
| 16 | +ENV GRAMPSWEB_MEDIA_BASE_DIR=/workspaces/web-api/data/media |
| 17 | +ENV GRAMPSWEB_SEARCH_INDEX_DB_URI=sqlite:////workspaces/web-api/data/indexdir/search_index.db |
| 18 | +ENV GRAMPSWEB_STATIC_PATH=/workspaces/web-api/data/static |
| 19 | +ENV GRAMPSWEB_THUMBNAIL_CACHE_CONFIG__CACHE_DIR=/workspaces/web-api/data/thumbnail_cache |
| 20 | +ENV GRAMPSWEB_REPORT_DIR=/workspaces/web-api/data/reports_cache |
| 21 | +ENV GRAMPSWEB_EXPORT_DIR=/workspaces/web-api/data/export_cache |
| 22 | +ENV GRAMPSHOME=/workspaces/web-api/data/ |
| 23 | +ENV GRAMPS_DATABASE_PATH=/workspaces/web-api/data/grampsdb |
| 24 | +ENV GRAMPSWEB_TREE=Gramps\ Web |
| 25 | +# Do not use this value in production!! |
| 26 | +ENV GRAMPSWEB_SECRET_KEY=QAVoeYDzkQves9iDZ5PkxfdUoVElVMVYPqz-QXha6yE |
| 27 | +ENV GRAMPSWEB_CORS_ORIGINS="*" |
| 28 | +ENV GRAMPSWEB_VECTOR_EMBEDDING_MODEL=sentence-transformers/distiluse-base-multilingual-cased-v2 |
| 29 | +ENV GRAMPSWEB_CELERY_CONFIG__broker_url=redis://redis:6379/0 |
| 30 | +ENV GRAMPSWEB_CELERY_CONFIG__result_backend=redis://redis:6379/0 |
| 31 | + |
| 32 | +# CPU-only version of PyTorch |
| 33 | +RUN pip install torch --index-url https://download.pytorch.org/whl/cpu |
| 34 | +RUN pip install sentence-transformers |
| 35 | + |
| 36 | +# download and cache sentence transformer model |
| 37 | +RUN python3 -c "from sentence_transformers import SentenceTransformer; \ |
| 38 | +model = SentenceTransformer('sentence-transformers/distiluse-base-multilingual-cased-v2')"; |
| 39 | + |
0 commit comments