Cypher init script Neo4j 4.2 docker not working

I am trying to refer to this link of documentation: Cypher init script - APOC Extended Documentation

This is my docker command:

docker run --rm \
--env NEO4J_AUTH="neo4j/test" \
--env NEO4JLABS_PLUGINS='["apoc"]' \
--env NEO4J_apoc_export_file_enabled="true" \
--env NEO4J_apoc_import_file_enabled="true" \
--env NEO4J_apoc_import_file_use__neo4j__config="true" \
--env NEO4J_dbms_directories_import="/" \
--env NEO4J_apoc_initializer_neo4j_1='CALL apoc.cypher.runSchemaFile("file:////var/lib/neo4j/db_init_scripts/db_ddls.cypher");' \
--env NEO4J_apoc_initializer_neo4j_2='CALL apoc.cypher.runFile("file:////var/lib/neo4j/db_init_scripts/db_schema.cypher");' \
--name neo4j \
neo4j:cus

where neo4j:cus is my custom image where I copied the required cypher files into neo4j:4.2 image

My db_ddl.cypher has create indexes:

CREATE CONSTRAINT idx_person_unq IF NOT EXISTS ON (p:Person) ASSERT p.name IS UNIQUE;

My db_schema.cypher has schema creation:

MERGE (p:Person {name: "Inital Person"});

When I try to start the container, I get below message:

Unrecognized setting. No declared setting with name: apoc.initializer.cypher.1
Unrecognized setting. No declared setting with name: apoc.initializer.cypher.2

When I try to use, older version of environment variables:

--env NEO4J_apoc_initializer_cypher_1='CALL apoc.cypher.runSchemaFile("file:////var/lib/neo4j/db_init_scripts/db_schema.cypher");' \
--env NEO4J_apoc_initializer_cypher_2='CALL apoc.cypher.runFile("file:////var/lib/neo4j/db_init_scripts/db_ddls.cypher");' \

I get this:

Unrecognized setting. No declared setting with name: apoc.initializer.cypher.1
Unrecognized setting. No declared setting with name: apoc.initializer.cypher.2

But when I try to run only one cypher:

--env NEO4J_apoc_initializer_cypher='CALL apoc.cypher.runSchemaFile("file:////var/lib/neo4j/db_init_scripts/db_ddls.cypher");' \

Then it works.

This is how my conf/neo4j.conf looks:

root@4f8955759b52:/var/lib/neo4j# grep apoc conf/neo4j.conf
#dbms.security.procedures.allowlist=apoc.coll.*,apoc.load.*,gds.*
apoc.initializer.neo4j.1=CALL apoc.cypher.runFile("file:////var/lib/neo4j/db_init_scripts/db_schema.cypher");
apoc.initializer.neo4j.0=CALL apoc.cypher.runSchemaFile("file:////var/lib/neo4j/db_init_scripts/db_ddls.cypher");
apoc.import.file.use_neo4j_config=true
apoc.import.file.enabled=true
apoc.export.file.enabled=true
dbms.security.procedures.unrestricted=apoc.*

Can anyone point what I am missing so that I can run both creation of indexes as well as initialize some schema as well?

Thanks

Well this behavior works only when you create a separate apoc.conf file and place it beside neo4j.conf

my apoc.conf now looks like this:

apoc.initializer.neo4j.1=CALL apoc.cypher.runSchemaFile("file:////var/lib/neo4j/db_init_scripts/db_ddls.cypher")
apoc.initializer.neo4j.2=CALL apoc.cypher.runFile("file:////var/lib/neo4j/db_init_scripts/db_schema.cypher");

And log files have outputs:

2021-05-26 18:51:06.068+0000 INFO  [neo4j/c0fb7489] successfully initialized: CALL apoc.cypher.runSchemaFile("file:////var/lib/neo4j/db_init_scripts/db_ddls.cypher")
2021-05-26 18:51:06.882+0000 INFO  Remote interface available at http://localhost:7474/
2021-05-26 18:51:06.892+0000 INFO  Started.
2021-05-26 18:51:08.091+0000 INFO  [neo4j/c0fb7489] successfully initialized: CALL apoc.cypher.runFile("file:////var/lib/neo4j/db_init_scripts/db_schema.cypher");