cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How to pass geocoder configuration in neo4j docker-compose file

Hi I am running Neo4j community 4.0.3 edition using docker. I have to use apoc geocoder features in my graph, so i have created a neo4j service in my docker-compose file which look like this, but once service is up, still i am not able to get Google Geocode, instead of I am getting default geocode feature.

neo4j:
image: neo4j:latest
environment:
- NEO4J_dbms_security_procedures_unrestricted=apoc.*
- NEO4J_apoc_import_file_enabled=true
- NEO4JLABS_PLUGINS=["apoc"]
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_AUTH=USERNAME/PASSWORD
- NEO4j_apoc_spatial_geocode_provider=google
- NEO4j_apoc_spatial_geocode_google_key=KEY
ports:
- '7474:7474'
- '7473:7473'
- '7687:7687'
volumes:
- ./neo4j_data:/var/lib/neo4j/data

1 ACCEPTED SOLUTION

Config mechanism in APOC 4.x changed, you can now use either apoc.conf, env variables or system properties, see https://neo4j.com/docs/labs/apoc/current/config/

For docker-compose the easiest way is to use env variables. Try:

environment:
- NEO4J_dbms_security_procedures_unrestricted=apoc.*
- NEO4J_apoc_import_file_enabled=true
- NEO4JLABS_PLUGINS=["apoc"]
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_AUTH=USERNAME/PASSWORD
- apoc.spatial.geocode.provider=google
- apoc.spatial.geocode.google.key=KEY

NOTE: you don't have to transpose "." to "_" for the apoc variables. This is just needed for the NEO4J_xxx settings since they are added to neo4j.conf.

View solution in original post

2 REPLIES 2

Config mechanism in APOC 4.x changed, you can now use either apoc.conf, env variables or system properties, see https://neo4j.com/docs/labs/apoc/current/config/

For docker-compose the easiest way is to use env variables. Try:

environment:
- NEO4J_dbms_security_procedures_unrestricted=apoc.*
- NEO4J_apoc_import_file_enabled=true
- NEO4JLABS_PLUGINS=["apoc"]
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_AUTH=USERNAME/PASSWORD
- apoc.spatial.geocode.provider=google
- apoc.spatial.geocode.google.key=KEY

NOTE: you don't have to transpose "." to "_" for the apoc variables. This is just needed for the NEO4J_xxx settings since they are added to neo4j.conf.

Thanks Stefan, its working.