Stopping the container CMD process without stopping the container?

I’m working with the Neo4j Community Docker container (docker-neo4j-publish/5.23.0/bullseye/community/Dockerfile at 8e55c5a5629327d318a63703f4f4f361c97c6293 · neo4j/docker-neo4j-publish · GitHub)

ENTRYPOINT ["tini", "-g", "--", "/startup/docker-entrypoint.sh"]
CMD ["neo4j"]

The Community edition only supports offline backups and there are instructions to perform this when running with Docker desktop.

However, when I move this into a runtime like AWS ECS, running neo4j stop seems to kill the container and causes the orchestrator to redeploy the container.

I’m wondering if there’s some way I can change the startup of the container in some way that will allow me to stop the neo4j process without killing the container instance.

Just out of curiosity: you do understand that a stopped ecs task (aka the container) is removed after the container is stopped? How is changing anything in the image supposed to change that behavior?

Have you considered mounting an efs share into the container path, so your data is persisted outside the container?

you do understand that a stopped ecs task (aka the container) is removed after the container is stopped?

Of course that is the case :slight_smile: and therefore, the problem. Stopping the neo4j service also causes the container to stop and thus I cannot issue the next command to via exec to dump the database and then restart the service.

Have you considered mounting an efs share into the container path

It is already mounted via EFS, but the Neo4j process creates a lock file so the command to dump the database into an archive will fail because neo4j is holding the lock file. To dump the database, I need to first stop neo4j.