mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Merge pull request #6786 from Ocelot-Social-Community/6785-refine-deployments-docker-compose-yml
docs(other): refine deployments `docker-compose.yml` in deployment and main folder
This commit is contained in:
commit
78f64eebd9
@ -142,19 +142,35 @@ services:
|
|||||||
- 3001:80
|
- 3001:80
|
||||||
|
|
||||||
neo4j:
|
neo4j:
|
||||||
|
# Neo4j v3.5.14-community
|
||||||
|
# image: wollehuss/neo4j-community-branded:latest
|
||||||
|
# Neo4j 4.4-community
|
||||||
image: ocelotsocialnetwork/neo4j-community:latest
|
image: ocelotsocialnetwork/neo4j-community:latest
|
||||||
container_name: neo4j-branded
|
container_name: neo4j-branded
|
||||||
networks:
|
networks:
|
||||||
- test-network
|
- test-network
|
||||||
|
ports:
|
||||||
|
- 7687:7687
|
||||||
|
# only for development
|
||||||
|
# - 7474:7474
|
||||||
|
- 7474:7474
|
||||||
volumes:
|
volumes:
|
||||||
- neo4j_data:/data
|
- neo4j_data:/data
|
||||||
environment:
|
environment:
|
||||||
|
# settings reference: https://neo4j.com/docs/operations-manual/4.4/docker/ref-settings/
|
||||||
|
# TODO: This sounds scary for a production environment
|
||||||
- NEO4J_AUTH=none
|
- NEO4J_AUTH=none
|
||||||
- NEO4J_dbms_security_procedures_unrestricted=algo.*,apoc.*
|
- NEO4J_dbms_security_procedures_unrestricted=algo.*,apoc.*
|
||||||
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
|
- NEO4J_dbms_allow__format__migration=true
|
||||||
ports:
|
- NEO4J_dbms_allow__upgrade=true
|
||||||
- 7687:7687
|
# TODO: clarify if that is the only thing needed to unlock the Enterprise version
|
||||||
- 7474:7474
|
# - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
|
||||||
|
# Uncomment following line for Neo4j Enterprise version instead of Community version
|
||||||
|
# TODO: clarify if that is the only thing needed to unlock the Enterprise version
|
||||||
|
# - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
|
||||||
|
# TODO: Remove the playground from production
|
||||||
|
# bring the database in offline mode to export or load dumps
|
||||||
|
# command: ["tail", "-f", "/dev/null"]
|
||||||
|
|
||||||
mailserver:
|
mailserver:
|
||||||
image: djfarrelly/maildev
|
image: djfarrelly/maildev
|
||||||
|
|||||||
@ -137,7 +137,7 @@ $ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-neo4j
|
|||||||
# bash: enter bash of Neo4j
|
# bash: enter bash of Neo4j
|
||||||
$ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-neo4j | awk '{ print $1 }') -- bash
|
$ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-neo4j | awk '{ print $1 }') -- bash
|
||||||
# generate Dump
|
# generate Dump
|
||||||
neo4j% neo4j-admin dump --to=/var/lib/neo4j/$(date +%F)-neo4j-dump
|
neo4j% neo4j-admin dump --database=graph.db --to=/var/lib/neo4j/$(date +%F)-neo4j-dump
|
||||||
# exit bash
|
# exit bash
|
||||||
neo4j% exit
|
neo4j% exit
|
||||||
|
|
||||||
|
|||||||
@ -108,6 +108,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- neo4j_data:/data
|
- neo4j_data:/data
|
||||||
environment:
|
environment:
|
||||||
|
# settings reference: https://neo4j.com/docs/operations-manual/4.4/docker/ref-settings/
|
||||||
# TODO: This sounds scary for a production environment
|
# TODO: This sounds scary for a production environment
|
||||||
- NEO4J_AUTH=none
|
- NEO4J_AUTH=none
|
||||||
- NEO4J_dbms_security_procedures_unrestricted=algo.*,apoc.*
|
- NEO4J_dbms_security_procedures_unrestricted=algo.*,apoc.*
|
||||||
|
|||||||
@ -53,15 +53,45 @@ Start Neo4J and confirm the database is running at [http://localhost:7474](http:
|
|||||||
|
|
||||||
## Operations on Neo4j
|
## Operations on Neo4j
|
||||||
|
|
||||||
### Import Neo4j Dump Locally in Docker
|
### Docker or Docker Compose
|
||||||
|
|
||||||
|
- we need to set `command: ["tail", "-f", "/dev/null"]` in the Neo4j block of `docker-compose.yml` on top level so the Neo4j database is in maintenance mode
|
||||||
|
|
||||||
|
### Create Neo4j Dump
|
||||||
|
|
||||||
|
To create a dump in Neo4j running in a Docker container:
|
||||||
|
|
||||||
|
- set the database to maintenance mode, see above
|
||||||
|
- entering the following commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# connect to the Docker containers Neo4j terminal
|
||||||
|
$ docker exec -it neo4j bash
|
||||||
|
# generate Dump
|
||||||
|
neo4j% neo4j-admin dump --database=graph.db --to=/var/lib/neo4j/$(date +%F)-neo4j-dump
|
||||||
|
# exit bash
|
||||||
|
neo4j% exit
|
||||||
|
# copy the dump out of the running Docker container
|
||||||
|
$ docker cp <docker-image-name('neo4j')>:/var/lib/neo4j/neo4j-dump <local-folder-path>/$(date +%F)-neo4j-dump
|
||||||
|
```
|
||||||
|
|
||||||
|
### Import Neo4j Dump
|
||||||
|
|
||||||
To import a dump into Neo4j running in a Docker container:
|
To import a dump into Neo4j running in a Docker container:
|
||||||
|
|
||||||
- we need to set `command: ["tail", "-f", "/dev/null"]` in the Neo4j block of `docker-compose.yml` on top level so the Neo4j database is in maintenance mode
|
- set the database to maintenance mode, see above
|
||||||
- copy the dump into the running Docker container: `docker cp /path/to/dump <docker-image>:/existing-directory-in-docker/`
|
- entering the following commands:
|
||||||
- connect to the Docker containers Neo4j terminal: `docker exec -it neo4j bash`
|
|
||||||
- to load the dump into the database we need the following command in this terminal: `neo4j-admin load --expand-commands --database=graph.db --from /backups/neo4j-dump --force`
|
```bash
|
||||||
- leave the terminal by entering: `exit`
|
# copy the dump into the running Docker container
|
||||||
|
$ docker cp <local-folder-path>/neo4j-dump <docker-image-name('neo4j')>:/var/lib/neo4j/$(date +%F)-neo4j-dump
|
||||||
|
# connect to the Docker containers Neo4j terminal
|
||||||
|
$ docker exec -it neo4j bash
|
||||||
|
# to load the dump into the database we need the following command in this terminal
|
||||||
|
neo4j% neo4j-admin load --expand-commands --database=graph.db --from /var/lib/neo4j/$(date +%F)-neo4j-dump --force
|
||||||
|
# leave the terminal by entering
|
||||||
|
neo4j% exit
|
||||||
|
```
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user