-
-
Notifications
You must be signed in to change notification settings - Fork 175
/
Copy pathdocker-entrypoint.sh
49 lines (36 loc) · 1.89 KB
/
docker-entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
#
# docker-entrypoint for opensemanticsearch/open-semantic-search
OPEN_SEMANTIC_SEARCH_VERSION="21.12.28"
echo $OPEN_SEMANTIC_SEARCH_VERSION > /etc/opensemanticsearch/version
cp -na /var/lib/opensemanticsearch/etc-volume/. /etc/opensemanticsearch/
cp -na /var/lib/opensemanticsearch/var-volume/. /var/opensemanticsearch/
# Copy default config from php directory config to systems config directory /etc
cp -na /usr/share/solr-php-ui/etc-volume/. /etc/solr-php-ui/
# allow Django running in apache2 context to write facets config
chgrp www-data /etc/opensemanticsearch/facets
chmod g+rw /etc/opensemanticsearch/facets
# allow Django running in apache2 context to write ETL config
chgrp www-data /etc/opensemanticsearch/etl-webadmin
chmod g+rw /etc/opensemanticsearch/etl-webadmin
# allow Django running in apache2 context to write OCR dictionary
chown www-data:www-data /etc/opensemanticsearch/ocr/dictionary.txt
chmod o+r /etc/opensemanticsearch/ocr/dictionary.txt
# allow Django running in apache2 context to write UI config
chgrp www-data /etc/solr-php-ui/config.webadmin.php
chmod g+rw /etc/solr-php-ui/config.webadmin.php
chgrp www-data /etc/solr-php-ui/config.facets.php
chmod g+rw /etc/solr-php-ui/config.facets.php
# create or upgrade DB
mkdir -p /var/opensemanticsearch/db
python3 /var/lib/opensemanticsearch/manage.py migrate
# allow Django running in apache2 context to read and write the database
chown -R www-data:www-data /var/opensemanticsearch
# but others should not be able to read DB entries
chmod -R o-rwx /var/opensemanticsearch/db
# write Open Semantic ETL config and Solr PHP UI config by settings of web admin ui / in Django DB
python3 /var/lib/opensemanticsearch/manage.py configs
# setup facets/classes in Open Semantic ETL config and index entities in Open Semantic Entity Search API
python3 /var/lib/opensemanticsearch/manage.py entities
# Start apache2
/usr/sbin/apache2ctl -D FOREGROUND