I have created a database and would like to host it inside a docker container on some server. I do not want a "random stranger" to change my database, so I would like to give everybody accessing the database in the container only reading privileges. How can I achieve this?
Currently, I am building my image as follows (for details, see the code below):
starting from neo4j:4.2.2-community, I load the dumped version of my database into the image (overwriting database neo4j) and specify NEO4J_dbms_read__only=true (as this is the setting that I found: https://neo4j.com/docs/operations-manual/4.2/reference/configuration-settings/ (dbms.read_only))
The image is built, but when I try to run the container, the database neo4j does not start due to the error
Caused by: org.neo4j.index.internal.gbptree.TreeFileNotFoundException: Can not create new tree file in read only mode.
Removing the read-only option, everything is fine.
FROM neo4j:4.2.2-community
RUN apt-get update; apt-get -y install curl
COPY dump_test /.
COPY ./docker-entrypoint.sh /.
COPY ./execute-init-script.sh /.
RUN /var/lib/neo4j/bin/neo4j-admin load --database=neo4j --from=/dump_test --force
RUN chmod +x /docker-entrypoint.sh && chmod +x /execute-init-script.sh
ENV NEO4J_EDITION="community" \
NEO4J_ACCEPT_LICENSE_AGREEMENT="yes" \
NEO4J_dbms_read__only=true