mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Configure scripts and docker-compose.yml
After endless try/error I found the way to share volumes between multiple docker-compose.ymls: You have to place those files in the same folder. Also the import scripts must be adapted.
This commit is contained in:
parent
099a5c9cf4
commit
bcc2c4dbbb
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
for var in "SSH_USERNAME" "SSH_HOST" "MONGODB_USERNAME" "MONGODB_PASSWORD" "MONGODB_DATABASE" "MONGODB_AUTH_DB" "NEO4J_URI"
|
for var in "SSH_USERNAME" "SSH_HOST" "MONGODB_USERNAME" "MONGODB_PASSWORD" "MONGODB_DATABASE" "MONGODB_AUTH_DB"
|
||||||
do
|
do
|
||||||
if [[ -z "${!var}" ]]; then
|
if [[ -z "${!var}" ]]; then
|
||||||
echo "${var} is undefined"
|
echo "${var} is undefined"
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
SECONDS=0
|
||||||
SCRIPT_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
SCRIPT_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
|
|
||||||
echo "MATCH (n) DETACH DELETE n;" | cypher-shell
|
echo "MATCH (n) DETACH DELETE n;" | cypher-shell
|
||||||
|
|
||||||
SECONDS=0
|
|
||||||
for collection in "badges" "categories" "users" "follows" "contributions" "shouts" "comments"
|
for collection in "badges" "categories" "users" "follows" "contributions" "shouts" "comments"
|
||||||
do
|
do
|
||||||
for chunk in /tmp/mongo-export/splits/$collection/*
|
for chunk in /tmp/mongo-export/splits/$collection/*
|
||||||
|
|||||||
@ -2,18 +2,19 @@ version: "3.4"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
maintenance:
|
maintenance:
|
||||||
command: "idle" # remove this line to start neo4j automatically
|
|
||||||
image: humanconnection/maintenance-worker:latest
|
image: humanconnection/maintenance-worker:latest
|
||||||
build:
|
build:
|
||||||
context: .
|
context: deployment/legacy-migration/maintenance-worker
|
||||||
volumes:
|
volumes:
|
||||||
- uploads:/uploads
|
- uploads:/uploads
|
||||||
- neo4j-data:/data
|
- neo4j-data:/data
|
||||||
- ./migration/:/migration
|
- ./deployment/legacy-migration/maintenance-worker/migration/:/migration
|
||||||
- ./ssh/:/root/.ssh
|
- ./deployment/legacy-migration/maintenance-worker/ssh/:/root/.ssh
|
||||||
networks:
|
networks:
|
||||||
- hc-network
|
- hc-network
|
||||||
environment:
|
environment:
|
||||||
|
- NEO4J_dbms_security_auth__enabled=false
|
||||||
|
- NEO4J_dbms_memory_heap_max__size=2G
|
||||||
- GRAPHQL_PORT=4000
|
- GRAPHQL_PORT=4000
|
||||||
- GRAPHQL_URI=http://localhost:4000
|
- GRAPHQL_URI=http://localhost:4000
|
||||||
- CLIENT_URI=http://localhost:3000
|
- CLIENT_URI=http://localhost:3000
|
||||||
@ -22,7 +23,6 @@ services:
|
|||||||
- MAPBOX_TOKEN=pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.KZ8KK9l70omjXbEkkbHGsQ
|
- MAPBOX_TOKEN=pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.KZ8KK9l70omjXbEkkbHGsQ
|
||||||
- PRIVATE_KEY_PASSPHRASE=a7dsf78sadg87ad87sfagsadg78
|
- PRIVATE_KEY_PASSPHRASE=a7dsf78sadg87ad87sfagsadg78
|
||||||
- NEO4J_apoc_import_file_enabled=true
|
- NEO4J_apoc_import_file_enabled=true
|
||||||
- NEO4J_AUTH=none
|
|
||||||
- "SSH_USERNAME=${SSH_USERNAME}"
|
- "SSH_USERNAME=${SSH_USERNAME}"
|
||||||
- "SSH_HOST=${SSH_HOST}"
|
- "SSH_HOST=${SSH_HOST}"
|
||||||
- "MONGODB_USERNAME=${MONGODB_USERNAME}"
|
- "MONGODB_USERNAME=${MONGODB_USERNAME}"
|
||||||
@ -34,9 +34,11 @@ services:
|
|||||||
- 7687:7687
|
- 7687:7687
|
||||||
- 7474:7474
|
- 7474:7474
|
||||||
|
|
||||||
volumes:
|
|
||||||
uploads:
|
|
||||||
neo4j-data:
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
hc-network:
|
hc-network:
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
webapp_node_modules:
|
||||||
|
backend_node_modules:
|
||||||
|
neo4j-data:
|
||||||
|
uploads:
|
||||||
@ -18,6 +18,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./backend:/nitro-backend
|
- ./backend:/nitro-backend
|
||||||
- backend_node_modules:/nitro-backend/node_modules
|
- backend_node_modules:/nitro-backend/node_modules
|
||||||
|
- uploads:/nitro-backend/public/uploads
|
||||||
command: yarn run dev
|
command: yarn run dev
|
||||||
neo4j:
|
neo4j:
|
||||||
environment:
|
environment:
|
||||||
@ -32,3 +33,4 @@ volumes:
|
|||||||
webapp_node_modules:
|
webapp_node_modules:
|
||||||
backend_node_modules:
|
backend_node_modules:
|
||||||
neo4j-data:
|
neo4j-data:
|
||||||
|
uploads:
|
||||||
|
|||||||
@ -4,7 +4,11 @@
|
|||||||
# the initial default user. Before we can create constraints, we have to change
|
# the initial default user. Before we can create constraints, we have to change
|
||||||
# the default password. This is a security feature of neo4j.
|
# the default password. This is a security feature of neo4j.
|
||||||
if echo ":exit" | cypher-shell --password neo4j 2> /dev/null ; then
|
if echo ":exit" | cypher-shell --password neo4j 2> /dev/null ; then
|
||||||
neo4j-admin set-initial-password $NEO4J_PASSWORD
|
if [[ -z "${NEO4J_PASSWORD}" ]]; then
|
||||||
|
echo "NEO4J_PASSWORD environment variable is undefined. I cannot set the initial password."
|
||||||
|
else
|
||||||
|
echo "CALL dbms.security.changePassword('${NEO4J_PASSWORD}');" | cypher-shell --password neo4j
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@ -17,7 +21,6 @@ CREATE CONSTRAINT ON (c:Category) ASSERT c.id IS UNIQUE;
|
|||||||
CREATE CONSTRAINT ON (u:User) ASSERT u.id IS UNIQUE;
|
CREATE CONSTRAINT ON (u:User) ASSERT u.id IS UNIQUE;
|
||||||
CREATE CONSTRAINT ON (o:Organization) ASSERT o.id IS UNIQUE;
|
CREATE CONSTRAINT ON (o:Organization) ASSERT o.id IS UNIQUE;
|
||||||
CREATE CONSTRAINT ON (t:Tag) ASSERT t.id IS UNIQUE;
|
CREATE CONSTRAINT ON (t:Tag) ASSERT t.id IS UNIQUE;
|
||||||
CREATE CONSTRAINT ON (c:Category) ASSERT c.id IS UNIQUE;
|
|
||||||
|
|
||||||
|
|
||||||
CREATE CONSTRAINT ON (p:Post) ASSERT p.slug IS UNIQUE;
|
CREATE CONSTRAINT ON (p:Post) ASSERT p.slug IS UNIQUE;
|
||||||
@ -25,3 +28,6 @@ CREATE CONSTRAINT ON (c:Category) ASSERT c.slug IS UNIQUE;
|
|||||||
CREATE CONSTRAINT ON (u:User) ASSERT u.slug IS UNIQUE;
|
CREATE CONSTRAINT ON (u:User) ASSERT u.slug IS UNIQUE;
|
||||||
CREATE CONSTRAINT ON (o:Organization) ASSERT o.slug IS UNIQUE;
|
CREATE CONSTRAINT ON (o:Organization) ASSERT o.slug IS UNIQUE;
|
||||||
' | cypher-shell
|
' | cypher-shell
|
||||||
|
|
||||||
|
echo "Successfully created all indices and unique constraints:"
|
||||||
|
echo 'CALL db.indexes();' | cypher-shell
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user