Hello, I am currently doing an open source project that is a social network and when I am setting up the docker-compose I find myself stuck in a problem.
I have my backend service in springboot
I have my neo4j service
and I have a python service that generates a fake graph for me.
The service that generates the fake graph works as follows:
For each action block (create users, create friends, ...) first create the datasets in .csv files (in a folder called temp) and then import them into neo4j.
So my problem is how do I ensure that neo4j, in its import folder, receives the files that are being dynamically created in the temp folder of the fake_graph service.
This is the code of my docker-compose:
version: "3.8"
services:
# Noe4j database config
neo4j:
container_name: neo4j_social_seed_db
image: neo4j:5.15.0-enterprise
ports:
- "7474:7474"
- "7687:7687"
restart: always
environment:
- NEO4J_AUTH=neo4j/neo4jSocial
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_server.memory.pagecache.size=1G
- NEO4J_server.directories.import=import
volumes:
- ./neo4j/data:/data
- ./neo4j/conf:/conf
- ./neo4j/logs:/logs
- ./neo4j/plugins:/plugins
- ./fake-graph/app/temp:/import
networks:
- net
# Social Seed Api in Java config
social-seed-app:
container_name: app_social_seed
image: social-seed:0.0.1
build:
context: ./backend
ports:
- "8081:8081"
environment:
- DATABASE_URI=bolt://neo4j:7687
- DATABASE_USERNAME=neo4j
- DATABASE_PASSWORD=neo4jSocial
depends_on:
- neo4j
networks:
- net
# Fake Graph config
fake-graph:
container_name: fake_graph_service
image: python:3.11.2-slim
build:
context: ./fake_graph
volumes:
- ./fake_graph:/app
depends_on:
- neo4j
environment:
- GENERATE_FAKE_GRAPH
- DATABASE_URI=bolt://neo4j:7687
command: >
sh -c "if [ '$GENERATE_FAKE_GRAPH' = 'true' ]; then python /app/generate.py; else sleep infinity; fi"
networks:
- net
networks:
net: