So you have a working phovea app, when you realize that your app will need to run a neo4j database as well.
Luckily, there is a neo4j docker container you can fire up and connect to.
Note that in order for your neo4j docker and your server api (run by docker as well) to communicate, you should set them up in a single docker compose file, so that they are in the same 'sub network'.
But that's a story for another day. Today we are going to talk about how to update your workspace docker-compose file to accurately reflect the changes you've made to your project specific docker-compose file.
One of the key things to understand here, is that you should not be modifying any files in your workspace directly. That is not to say it won't work locally (it will) but the problem arises when you want to share your working app with others or even deploy it say on an Amazon EC2 instance.
All the files in your workspace are compiled from the files that exist in your individual project repos (say one for the client side, and one for the server side) with a special update command we will talk about shortly.
Because we are talking about updating the docker-compose.yml file today, let's focus on how to update your server repo (we wouldn't be using docker containers for the client side).
There is a folder inside your server repo that is (aptly) called deploy. In that folder, there is a docker-compose.partial.yml. This is the file we will be modifying. Notice that if you do not have any dependencier other than your current server, then this file will be empty.
Edit this file with any new docker-containers that you need for your application. Here is what my docker-compose.partial.yml looked like once I incorporated two neo4j databases.
version: "2.2"
services:
neo4j_path:
image: neo4j
ports:
- "7475:7474"
- "7688:7687"
volumes:
- '$PWD/lineage_server/neo4j/logs_path:/logs'
- '$PWD/lineage_server/neo4j/data_path:/data'
- '$PWD/lineage_server/neo4j/plugins_path:/plugins'
- '$PWD/lineage_server/neo4j/conf_path:/conf'
ulimits:
nproc: 65535
nofile:
soft: 40000
hard: 40000
environment:
NEO4J_AUTH: "none"
neo4j_got:
image: neo4j
ports:
- "7474:7474"
- "7687:7687"
volumes:
- '$PWD/lineage_server/neo4j/logs:/logs'
- '$PWD/lineage_server/neo4j/data:/data'
- '$PWD/lineage_server/neo4j/plugins:/plugins'
- '$PWD/lineage_server/neo4j/conf:/conf'
ulimits:
nproc: 65535
nofile:
soft: 40000
hard: 40000
environment:
NEO4J_AUTH: "none"
Once you have modified your .partial.yml file, we can go back to the workspace and tell phovea to rebuild the workspace files, include the all important docker-compose.yml.
This can be down either with yo phovea:workspace
or yo phovea:update
.