I've been using neo4j locally and am now trying to integrate it into my python based web application (using FastAPI and Starlette). My deployment strategy is to deploy a single docker container to elastic beanstalk. I am aware it is a docker anti-pattern to put too much into a single container, however, for time and cost reasons, this is the option I am left with.
My question is, how can I use neo4j as part of a multi-stage build?
Docker Page on Multi-stage builds
Stage 1: Build off of the provided neo4j docker image
Stage 1.b: configure the neo4j environment
Stage 2: Build off a python image
Stage 2.b configure the python application environment
Stage 2.c import requisite code from Stage 1
Note There are other use cases for this. One best practice is to deploy to your docker application only the requisite code needed to run, and it would be great to know if that option is available for the neo4j binary built by the jvm.
Thanks in advance.