Skip to content

Commit cc7d3dd

Browse files
committed
Switch to a standard GraphDB 10.x Docker image from DockerHub. Simplify configuration.
1 parent 2a88e30 commit cc7d3dd

File tree

6 files changed

+24
-58
lines changed

6 files changed

+24
-58
lines changed

.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
ROOT=/termit
22
URL=http://localhost
33
JWT_SECRET_KEY=TermIt-SvqaszimBKkhowbnPaal-Secr3tK3y
4-
GRAPHDB_FILE=graphdb-free-10.1.5-dist.zip

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ TermIt Docker serves to spin off a TermIt deployment, consisting of:
88

99
## Prerequisities
1010
1. Docker 19.03.0 or later & Docker Compose installed (and accessible under the current user).
11-
2. [GraphDB](https://www.ontotext.com) (Free, SE, EE) ZIP file downloaded (8.x or later).
1211

1312
### Resource Requirements
1413

@@ -21,18 +20,17 @@ Ideally, the whole deployment should have at least 4GB RAM available, with at le
2120

2221

2322
## Running TermIt
24-
1. Place your [GraphDB](https://www.ontotext.com) (Free, SE, EE) standalone server ZIP archive into the 'db-server' folder.
25-
2. Set `GRAPHDB_FILE` variable in `.env` to the name of the file you just downloaded.
26-
3. (_Optional_) Set `ROOT` variable in .env to reflect the local context prefix the app will be running on.
27-
4. (_Optional_) Set `URL` variable in .env to reflect the server the app will be running on.
28-
5. (_Optional_, recommended) Set `JWT_SECRET_KEY` variable in .env. It should be a string of at least 32 characters that will be used to hash the JWT authentication token for logged-in users.
29-
6. Start the GraphDB server
23+
1. (_Optional_) If you have a license file for GraphDB (SE or EE), place it in the `db-server/license` directory.
24+
2. (_Optional_) Set `ROOT` variable in .env to reflect the local context prefix the app will be running on.
25+
3. (_Optional_) Set `URL` variable in .env to reflect the server the app will be running on.
26+
4. (_Optional_, recommended) Set `JWT_SECRET_KEY` variable in .env. It should be a string of at least 32 characters that will be used to hash the JWT authentication token for logged-in users.
27+
5. Start the GraphDB server
3028
`docker-compose up -d termit-db-server`
31-
7. Go to `http://localhost:7200/import#server`, select the "termit" repository, and in the "Server files" section, click the "Import" button for all the files. In the "Import settings" dialog, set the Base IRI to `http://onto.fel.cvut.cz/ontologies/termit`.
32-
8. Go to `http://localhost:7200/sparql` and execute all the queries in the 'db-server/lucene' directory to create Lucene connectors for full-text search.
33-
9. Run the remaining services by
29+
6. Go to `http://localhost:7200/import#server`, select the "termit" repository, and in the "Server files" section, click the "Import" button for all the files. In the "Import settings" dialog, set the Base IRI to `http://onto.fel.cvut.cz/ontologies/termit`.
30+
7. Go to `http://localhost:7200/sparql` and execute all the queries in the 'db-server/lucene' directory to create Lucene connectors for full-text search.
31+
8. Run the remaining services by
3432
`docker-compose up -d`
35-
10. Look for admin credentials in the `termit-server` log and use them for first login at the configured URL, e.g. `http://localhost/termit`.
33+
9. Look for admin credentials in the `termit-server` log and use them for first login at the configured URL, e.g. `http://localhost/termit`.
3634

3735
## Configuration
3836

db-server/Dockerfile

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,24 @@
1-
FROM eclipse-temurin:11-jdk-alpine
1+
FROM ontotext/graphdb:10.2.0
22

3-
# Add bash, it is required by GraphDB run script
4-
RUN apk --no-cache add bash
5-
# Add curl
6-
RUN apk --no-cache add curl
3+
# Override parent entrypoint
4+
ENTRYPOINT []
75

8-
ARG GRAPHDB_ZIP
6+
ENV GRAPHDB_HOME=/opt/graphdb/home
7+
ENV GRAPHDB_INSTALL_DIR=/opt/graphdb/dist
98

10-
RUN \
11-
# Check for mandatory build arguments
12-
: "${GRAPHDB_ZIP:?Provide the downloaded GraphDB Free ZIP file}"
9+
WORKDIR ${GRAPHDB_HOME}
10+
# Copy license file if it exists
11+
COPY ./license/. ${GRAPHDB_HOME}/conf/
1312

14-
ENV GRAPHDB_VOLUME=/graphdb
15-
ENV GRAPHDB_HOME=${GRAPHDB_VOLUME}/home
16-
ENV GRAPHDB_INSTALL_DIR=${GRAPHDB_VOLUME}/dist
17-
RUN mkdir -p $GRAPHDB_VOLUME $GRAPHDB_INSTALL_DIR $GRAPHDB_HOME
18-
19-
ADD $GRAPHDB_ZIP /tmp/$GRAPHDB_ZIP
20-
21-
WORKDIR /tmp
22-
RUN unzip $GRAPHDB_ZIP
23-
RUN export GRAPHDB_DIR=`ls -d graphdb*/` && mv $GRAPHDB_DIR/* $GRAPHDB_INSTALL_DIR
24-
25-
ENV PATH=${GRAPHDB_INSTALL_DIR}/bin:$PATH
26-
27-
COPY rulesets ${GRAPHDB_HOME}/rulesets
13+
# Copy our custom ruleset
14+
COPY rulesets rulesets
2815

16+
# Copy initialization data and repository config
2917
COPY init-data /root/graphdb-import
3018
COPY init-config /termit-repo-config
3119
COPY repo-init.sh ${GRAPHDB_INSTALL_DIR}/repo-init.sh
3220

33-
COPY conf ${GRAPHDB_HOME}/conf
34-
3521
EXPOSE 7200
3622

37-
CMD ${GRAPHDB_INSTALL_DIR}/repo-init.sh /termit-repo-config ${GRAPHDB_HOME} & ${GRAPHDB_INSTALL_DIR}/bin/graphdb -Dgraphdb.home=${GRAPHDB_HOME} -Dgraphdb.logback=conf/logback.xml
23+
CMD ${GRAPHDB_INSTALL_DIR}/repo-init.sh /termit-repo-config ${GRAPHDB_HOME} & ${GRAPHDB_INSTALL_DIR}/bin/graphdb -Dgraphdb.home=${GRAPHDB_HOME} -Dgraphdb.logback=${GRAPHDB_INSTALL_DIR}/conf/logback.xml
3824

db-server/Dockerfile-se-ee

Lines changed: 0 additions & 15 deletions
This file was deleted.

db-server/init-config/config.ttl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<#termit> a rep:Repository;
88
rep:repositoryID "termit";
99
rep:repositoryImpl [
10-
rep:repositoryType "graphdb:FreeSailRepository";
10+
rep:repositoryType "graphdb:SailRepository";
1111
<http://www.openrdf.org/config/repository/sail#sailImpl> [
1212
<http://www.ontotext.com/trree/owlim#base-URL> "http://example.org/owlim#";
1313
<http://www.ontotext.com/trree/owlim#check-for-inconsistencies> "false";
@@ -28,7 +28,7 @@
2828
<http://www.ontotext.com/trree/owlim#ruleset> "/graphdb/home/rulesets/rules-termit-graphdb.pie";
2929
<http://www.ontotext.com/trree/owlim#storage-folder> "storage";
3030
<http://www.ontotext.com/trree/owlim#throw-QueryEvaluationException-on-timeout> "false";
31-
sail:sailType "graphdb:FreeSail"
31+
sail:sailType "graphdb:Sail"
3232
]
3333
];
3434
rdfs:label "TermIt Repository" .

docker-compose.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@ services:
1717
termit-db-server:
1818
build:
1919
context: db-server
20-
args:
21-
GRAPHDB_ZIP: $GRAPHDB_FILE
2220
image: termit-db-server
2321
environment:
2422
GDB_JAVA_OPTS: -Dgraphdb.external-url=${URL}${ROOT}/sluzby/db-server -Ddefault.min.distinct.threshold=67108864
2523
restart: always
2624
ports:
2725
- "7200:7200"
2826
volumes:
29-
- termit-db-server:/graphdb/home
27+
- termit-db-server:/opt/graphdb/home
3028
termit-server:
3129
image: kbsscvut/termit
3230
depends_on:

0 commit comments

Comments
 (0)