Skip to content

Commit

Permalink
Neo4j docker docs: tweaks following GCP deploy
Browse files Browse the repository at this point in the history
merges #36
refs #35
  • Loading branch information
dongbohu committed Dec 10, 2020
1 parent a95ae76 commit 31a97c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion hetnet/neo4j/deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ cd ~/docker-scripts/
./run-docker.sh
```

Wait for a few minutes before the web server is up, because the server needs to initialize the databases and guides.
Wait for ~15 minutes before the web server is up, because the server needs to initialize the databases and guides.

Please also make sure that your firewall setup on deployment box allows inbound traffic to port **7687**.

To reconfigure SSL later, please reset `EMAIL` and `SSL_DOMAIN` as described earlier, then type:

Expand Down
8 changes: 5 additions & 3 deletions hetnet/neo4j/deployment/install_ssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ sudo certbot certonly \
cat > ./sync-neo4j-ssl.sh << EOF
#!/bin/bash
# Certbot deploy-renewal-hook script, which synchronizes SSL certificates for neo4j.
# This script will be executed ONLY WHEN certificate is renewed successfully.
# This script will be executed ONLY WHEN SSL certificate has been renewed successfully.
# Use 'cp --dereference' to emphasize that we are copying the actual files.
cp --dereference --force /etc/letsencrypt/live/$SSL_DOMAIN/fullchain.pem /home/ubuntu/ssl/neo4j.cert
cp --dereference --force /etc/letsencrypt/live/$SSL_DOMAIN/privkey.pem /home/ubuntu/ssl/neo4j.key
# neo4j docker users neo4j user with id 101 and must be able to read neo4j.key. See https://github.com/hetio/hetionet/pull/26#issuecomment-547090526
# Docker container "hetionet-container" uses "neo4j" account (uid 101), who needs to read "neo4j.key".
# See https://github.com/hetio/hetionet/pull/26#issuecomment-547090526
chmod 644 /home/ubuntu/ssl/neo4j.key
EOF

Expand All @@ -40,7 +42,7 @@ chmod +x ./sync-neo4j-ssl.sh
sudo ./sync-neo4j-ssl.sh

# If hetionet-container is running now, restart it to make the new certificates effective.
if [ -n $(docker ps --quiet --filter name=hetionet-container) ]; then
if [ -n "$(docker ps --quiet --filter name=hetionet-container)" ]; then
echo -n "Restarting "
docker restart hetionet-container
fi
Expand Down
3 changes: 3 additions & 0 deletions hetnet/neo4j/deployment/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@ mkdir -p ~/docker-scripts/
cp -f run-docker.sh stop-docker.sh update-docker.sh ~/docker-scripts/
chmod +x ~/docker-scripts/*.sh

# Create data and log directories, which will be populated by docker container.
mkdir ~/hetionet-data ~/neo4j-logs

# Install SSL certificates issued by Let's Encrypt
bash ./install_ssl.sh

0 comments on commit 31a97c9

Please sign in to comment.