Browse Source

Neo4j + OpenJDK: Experimental Build, also switched to smaller base. This container now clocks in under 190MB in total. Removed Oracle Java, using OpenJDK.

master
Erle Pereira 5 years ago
parent
commit
db8635870c
6 changed files with 228 additions and 0 deletions
  1. +35
    -0
      docker_alpine_neo4j/Dockerfile
  2. +75
    -0
      docker_alpine_neo4j/conf/neo4j-server.properties
  3. +26
    -0
      docker_alpine_neo4j/conf/neo4j-wrapper.conf
  4. +2
    -0
      docker_alpine_neo4j/conf/neo4j.conf
  5. +35
    -0
      docker_alpine_neo4j/conf/neo4j.properties
  6. +55
    -0
      docker_alpine_neo4j/etc/init.d/neo4j

+ 35
- 0
docker_alpine_neo4j/Dockerfile View File

@@ -0,0 +1,35 @@
FROM alpine
MAINTAINER Erle Pereira <erle@erlepereira.com>

ENV neohome /usr/local/neo4j-server
ENV neolib /var/lib/neo4j-server

RUN apk --update add openjdk7-jre-base wget bash
RUN wget http://neo4j.com/artifact.php?name=neo4j-community-2.2.2-unix.tar.gz -O /tmp/neo4j.tar.gz && \
adduser -h ${neohome} -S neo4j && \
addgroup neo4j && \
cd /tmp && \
mkdir neo4j && \
tar -zxf neo4j.tar.gz -C ./ && \
rm neo4j.tar.gz && \
mv neo4j-community-2.2.2/* ${neohome} && \
ln -s ${neohome}/bin/neo4j /usr/local/bin/neo4j && \
mkdir ${neolib} && \
chown -R neo4j:neo4j ${neohome} && \
chown -R neo4j:neo4j ${neolib}

VOLUME ${neolib}

ADD etc/init.d/neo4j /etc/init.d/neo4j
ADD conf/neo4j-server.properties ${neohome}/conf/neo4j-server.properties
ADD conf/neo4j.properties ${neohome}/conf/neo4j.properties
ADD conf/neo4j-wrapper.conf ${neohome}/conf/neo4j-wrapper.conf
ADD conf/neo4j.conf /etc/security/limits.d/neo4j.conf

RUN chmod +x /etc/init.d/neo4j

USER neo4j

EXPOSE 7474
CMD ["neo4j", "console"]

+ 75
- 0
docker_alpine_neo4j/conf/neo4j-server.properties View File

@@ -0,0 +1,75 @@
################################################################
# Neo4j configuration
#
################################################################

#***************************************************************
# Server configuration
#***************************************************************

# location of the database directory
org.neo4j.server.database.location=/var/lib/neo4j-server/data/graph.db

# let the webserver only listen on the specified IP. Default
# is localhost (only accept local connections). Uncomment to allow
# any connection. Please see the security section in the neo4j
# manual before modifying this.
org.neo4j.server.webserver.address=0.0.0.0

#
# HTTP Connector
#

# Turn http-support on/off, mostly if you want your
# server accessible via https only.
org.neo4j.server.webserver.http.enabled=true

# http port (for all data, administrative, and UI access)
org.neo4j.server.webserver.port=7474

#
# HTTPS Connector
#

# Turn https-support on/off
org.neo4j.server.webserver.https.enabled=true

# https port (for all data, administrative, and UI access)
org.neo4j.server.webserver.https.port=7473

# Certificate location (auto generated if the file does not exist)
org.neo4j.server.webserver.https.cert.location=conf/ssl/snakeoil.cert

# Private key location (auto generated if the file does not exist)
org.neo4j.server.webserver.https.key.location=conf/ssl/snakeoil.key

# Internally generated keystore (don't try to put your own
# keystore there, it will get deleted when the server starts)
org.neo4j.server.webserver.https.keystore.location=system/keystore

#*****************************************************************
# Administration client configuration
#*****************************************************************

# location of the servers round-robin database directory. possible values:
# - absolute path like /var/rrd
# - path relative to the server working directory like data/rrd
# - commented out, will default to the database data directory.
org.neo4j.server.webadmin.rrdb.location=data/rrd

# REST endpoint for the data API
# Note the / in the end is mandatory
org.neo4j.server.webadmin.data.uri=/db/data/

# REST endpoint of the administration API (used by Webadmin)
org.neo4j.server.webadmin.management.uri=/db/manage/

# Low-level graph engine tuning file
org.neo4j.server.db.tuning.properties=/usr/local/neo4j-server/conf/neo4j.properties


#Comma separated list of JAXRS packages contains JAXRS Resoruce, one package name for each mountpoint.
#the listed package names will be loaded under the mountpoints specified, uncomment this line
#to mount the org.neo4j.examples.server.unmanaged.HelloWorldResource.java from neo4j-examples
#under /examples/unmanaged, resulting in a final URL of http://localhost:7474/examples/unmanaged/helloworld/{nodeId}
#org.neo4j.server.thirdparty_jaxrs_classes=org.neo4j.examples.server.unmanaged=/examples/unmanaged

+ 26
- 0
docker_alpine_neo4j/conf/neo4j-wrapper.conf View File

@@ -0,0 +1,26 @@
#********************************************************************
# JVM Parameters
#********************************************************************
wrapper.java.additional.1=-Dorg.neo4j.server.properties=/usr/local/neo4j-server/conf/neo4j-server.properties
wrapper.java.additional.2=-Djava.util.logging.config.file=/usr/local/neo4j-server/conf/logging.properties

# Initial Java Heap Size (in MB)
wrapper.java.initmemory=32

# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=512

#********************************************************************
# Wrapper settings
#********************************************************************
# Override default pidfile and lockfile
wrapper.pidfile=/var/run/neo4j-server.pid
wrapper.lockfile=/var/run/neo4j-server.lock

# Name of the service
wrapper.name=neo4j

# User account to be used for linux installs. Will default to current
# user if not set.
wrapper.user=neo4j

+ 2
- 0
docker_alpine_neo4j/conf/neo4j.conf View File

@@ -0,0 +1,2 @@
neo4j - nofile 48000
neo4j - memlock unlimited

+ 35
- 0
docker_alpine_neo4j/conf/neo4j.properties View File

@@ -0,0 +1,35 @@
# Default values for the low-level graph engine
#neostore.nodestore.db.mapped_memory=25M
#neostore.relationshipstore.db.mapped_memory=50M
#neostore.propertystore.db.mapped_memory=90M
#neostore.propertystore.db.strings.mapped_memory=130M
#neostore.propertystore.db.arrays.mapped_memory=130M

# Enable this to be able to upgrade a store from 1.4 -> 1.5 or 1.4 -> 1.6
#allow_store_upgrade=true

# Enable this to specify a parser other than the default one. 1.5, 1.6, 1.7 are available
#cypher_parser_version=1.6

# Keep logical logs, helps debugging but uses more disk space, enabled for
# legacy reasons To limit space needed to store historical logs use values such
# as: "7 days" or "100M size" instead of "true"
keep_logical_logs=true

# Autoindexing

# Enable auto-indexing for nodes, default is false
node_auto_indexing=true

# The node property keys to be auto-indexed, if enabled
#node_keys_indexable=

# Enable auto-indexing for relationships, default is false
#relationship_auto_indexing=true

# The relationship property keys to be auto-indexed, if enabled
#relationship_keys_indexable=name,age

# Remote Shell port
remote_shell_port=1337


+ 55
- 0
docker_alpine_neo4j/etc/init.d/neo4j View File

@@ -0,0 +1,55 @@
#!/usr/bin/env bash
#
# neo4j
#
# chkconfig: - 58 48
# description: neo4j
# processname: neo4j

# Source networking configuration
if [ -f /etc/sysconfig/network ]; then source /etc/sysconfig/network; fi

# Exit if networking is not up
[ "$NETWORKING" = "no" ] && exit

start() {
# neo4j wrapper is smart enough to change user and do similar things.
/usr/local/bin/neo4j start
return $?
}

stop() {
/usr/local/bin/neo4j stop
return $?
}

restart() {
stop
start
}

status() {
/usr/local/bin/neo4j status
return $?
}


case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status $2
;;
*)
echo $"Usage: $0 {start|stop|restart|status [-v]|}"
exit 1
esac

exit $?

Loading…
Cancel
Save