Skip to content

Unable to mount local config folder with apoc.conf #461

@ThomasThelen

Description

@ThomasThelen

I have a neo4j local deployment that needs to have an apoc.conf file. To include this in the deployment, I'm mounting the local volume with apoc.conf into neo4j's container folder, /var/lib/neo4j/conf. When running docker-compose up, the container dies and I get an error message ( see steps below) in the docker logs.

Neo4j Version: 5.11.0-community-bullseye
Operating System: MacOS 13.5.1 (22G90)
API: Docker

Steps to reproduce

  1. Create ~/deployment
  2. Add the docker-compose.yml file below to it
  3. Create ~/deployment/neo4j/conf
  4. Add the apoc.conf file below to it
  5. Run docker-compose up
  6. See that the deployment failed
  7. Check the logs with docker ps --all and docker logs
  8. See similar error to sed: couldn't open temporary file /var/lib/neo4j/conf/sed8CXFyW: Permission denied
  9. See sed file in the mounted config folder

Expected behavior

The apoc.conf file is copied into the container, and the application runs without error

Actual behavior

A new file is created in the mounted directory without permissions, causing the deployment to fail

----------  1 thomas  staff    0 Sep  8 21:02 sedUqUrUV

Local setup

Filesystem

- deployment
   - docker-compose.yaml
   - neo4j
      - conf
         - apoc.conf

docker-compose.yml

services:
  neo4j:
    image: neo4j:5.11.0-community-bullseye
    container_name: neo4j
    ports:
      - "7474:7474"
      - "7687:7687"
    environment:
      - NEO4J_AUTH=neo4j/neo4j222
    volumes:
      - ~/deployment/neo4j/conf:/var/lib/neo4j/conf

apoc.conf

apoc.import.file.enable=true

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions