-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_docker_linux.sh
executable file
·95 lines (83 loc) · 2.88 KB
/
setup_docker_linux.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env bash
set -eu
# Make the directories required for running and persisting data in the neo4j database.
mkdir -p neo4j_docker/data
mkdir -p neo4j_docker/logs
mkdir -p neo4j_docker/conf
mkdir -p neo4j_docker/plugins
mkdir -p neo4j_docker/import
cd neo4j_docker/import
# Download the zenodo database flat zip.
ZENODO_URL="https://zenodo.org/records/14046116/files/procoggraph_flat_files_v1-0-2.zip?download=1"
curl "${ZENODO_URL}" -o procoggraph_flat_files_v1-0-2.zip
# Unzip the database flat files into the import directory, to be used by the import script.
unzip procoggraph_flat_files_v1-0-2.zip
cd ../../
# Specify fully qualified paths for building the compose yaml file (required for running docker volumes).
NEO4J_DOCKER_DIR=$(pwd)/neo4j_docker
PROCOGGRAPH_REPOSITORY=$(pwd)
# Create the docker-compose.yaml file
cat <<EOF > compose_build.yaml
services:
neo4j_build:
image: neo4j:latest
container_name: neo4j_build
ports:
- "7474:7474"
- "7687:7687"
volumes:
- ${NEO4J_DOCKER_DIR}/data:/data
- ${NEO4J_DOCKER_DIR}/logs:/logs
- ${NEO4J_DOCKER_DIR}/conf:/conf
- ${NEO4J_DOCKER_DIR}/plugins:/plugins
- ${NEO4J_DOCKER_DIR}/import:/var/lib/neo4j/import
- ${PROCOGGRAPH_REPOSITORY}/nextflow/bin/import_neo4j_data.sh:/import_neo4j_data.sh
environment:
- NEO4J_AUTH=neo4j/procoggraph
entrypoint: ["/bin/bash", "/import_neo4j_data.sh"]
EOF
cat <<EOF > compose_run.yaml
services:
neo4j_run:
image: neo4j:latest
container_name: neo4j_run
ports:
- "7474:7474"
- "7687:7687"
volumes:
- ${NEO4J_DOCKER_DIR}/data:/data
- ${NEO4J_DOCKER_DIR}/logs:/logs
- ${NEO4J_DOCKER_DIR}/conf:/conf
- ${NEO4J_DOCKER_DIR}/plugins:/plugins
- ${NEO4J_DOCKER_DIR}/import:/var/lib/neo4j/import
- ${PROCOGGRAPH_REPOSITORY}/nextflow/bin/import_neo4j_data.sh:/import_neo4j_data.sh
environment:
- NEO4J_PLUGINS=["apoc"]
- NEO4J_AUTH=neo4j/procoggraph
nginx:
image: nginx:latest
container_name: nginx
ports:
- "8080:80"
volumes:
- ${PROCOGGRAPH_REPOSITORY}/procogdash/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ${PROCOGGRAPH_REPOSITORY}/procogdash:/usr/share/nginx/html:ro
neodash:
image: neo4jlabs/neodash
container_name: neodash
ports:
- "5005:5005"
environment:
- ssoEnabled=false
- standalone=true
- standaloneProtocol=bolt
- standaloneHost=localhost
- standalonePort=7687
- standaloneDatabase=neo4j
- standaloneDashboardName=ProCogGraph
- standaloneDashboardDatabase=neo4j
- standaloneDashboardURL=http://localhost:8080/dashboard.json
stdin_open: true
tty: true
EOF
echo -e "\nSuccessfully downloaded database files and generated docker compose files. To get started, run 'docker compose -f compose_build.yaml up', then 'docker compose -f compose_run.yaml up'.\n"