Update GraphDB Dockerfile

This commit is contained in:
Tom Wiesing 2020-06-17 15:51:20 +02:00
parent f92d2c6646
commit 9ece280e72
No known key found for this signature in database
GPG key ID: DC1F29F2BC78AB15
2 changed files with 10 additions and 7 deletions

View file

@ -1,4 +1,4 @@
# This container contains a Dockerfile for building a GraphDB zip.
# This Dockerfile contains instructions to compile and run GraphDB inside a Docker container.
# It is roughly based on https://github.com/Ontotext-AD/graphdb-docker/blob/master/free-edition/Dockerfile
# but has been modified for performance and security.
@ -47,7 +47,7 @@ EXPOSE 7200
# setup a healthcheck, that checks if the server is up.
RUN apt-get update && apt-get install -y curl
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD curl --fail 127.0.0.1:7200 || exit 1
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD curl --fail 127.0.0.1:7200/rest/repositories || exit 1
# Add volumes for data, work and logs as these might be accessible from the outside.
# To add your own configuration, manually mount a config file into /opt/graphdb/work

View file

@ -1,10 +1,13 @@
#!/bin/bash
set -e
# chown the volumes to graphdb
chown -R graphdb:graphdb /opt/graphdb/data
chown -R graphdb:graphdb /opt/graphdb/work
chown -R graphdb:graphdb /opt/graphdb/logs
# Because we want to run graphdb as a limited user
# we need to make sure that the volumes are writable.
# Because of that, we 'chown'
# run graphdb as a limited user
chown graphdb:graphdb /opt/graphdb/data
chown graphdb:graphdb /opt/graphdb/work
chown graphdb:graphdb /opt/graphdb/logs
# switch to the graphdb user, and run graphdb
su graphdb -c "/opt/graphdb/bin/graphdb $@"