version: '3'
services:
neo4j:
image: neo4j:3.5.5
volumes:
- ./conf:/var/lib/neo4j/conf
- ./mnt:/var/lib/neo4j/import
- ./plugins:/plugins
- ./data:/data
- ./logs:/var/lib/neo4j/logs
restart: always
ports:
- 7474:7474
- 7687:7687
environment:
- NEO4J_dbms_memory_heap_maxSize=4G
- NEO4J_AUTH=neo4j/123456
networks:
- my-network
networks:
my-network:
driver: bridge
first look at what the previous network is actually called:
[[email protected] cutter]# docker network ls
NETWORK ID NAME DRIVER SCOPE
1918b6df97b5 bridge bridge local
cd415863acc5 docker-neo4j_my-network bridge local
ee4b01a94aad host host local
0f77a2b4f416 none null local
You can see the original name of the original network to add the name of the original project directory, so the second docker-compose file is as follows:
version: '3'
services:
[service2-name]:
build: .
image: [service2-image-name]
restart: always
networks:
- docker-neo4j_my-network
...
networks:
docker-neo4j_my-network:
external: true