-
Notifications
You must be signed in to change notification settings - Fork 41
Setup and run graphspace docker image
Follow this tutorial to install docker in Ubuntu.
The reason we have a docker image is to make it easier for you to run GraphSpace on your local machine. Follow these steps to run the graphspace docker image on your machine:
- Clone the GraphSpace repo, branch e#264-docker-diff.
- Open
docker-compose.yml
file and plug in values incommand
.command: bash -c "./docker_command.sh <github username> <github repo url> <github branch name>"
- Run docker
Note: This might show a
sudo docker-compose up
NoBrokersAvailable
kafka error, stop the execution usingCtrl+C
and run the command again. - Go to
localhost:8000
in your browser to access GraphSpace.
Please do not try this if you do not know what you are doing
Learn more about editing docker images read this.
- Python v2.7.13
- Node
- Java v9
- PostgreSQL
- Elasticsearch v5.5.1
- Kafka v10.2
- Redis
- Supervisor
All the terminal commands can be found in the docker_command.sh
file in the docker image. Current content of the file is as follows:
#!/bin/bash
echo "Starting postgres"
service postgresql start
echo "Starting zookeeper"
service zookeeper start
echo "Sleeping for 5 seconds"
sleep 5
echo "Starting kafka"
nohup ~/kafka/bin/kafka-server-start.sh ~/kafka/config/server.properties > ~/kafka/kafka.log 2>&1 &
echo "Sleeping for 2 seconds"
sleep 2
echo "Starting redis"
redis-server /etc/redis/redis.conf
echo "Starting elasticsearch"
su - elasticsearch -c '/elasticsearch/bin/elasticsearch -d'
echo "Removing GraphSpace"
rm -rf GraphSpace
echo "Cloning GraphSpace"
git config --global user.email $1
git clone -b $3 $2
cd /GraphSpace
echo "Creating logs directory"
mkdir logs
> debug.log
echo "Create virtual env"
virtualenv venv
echo "Activate venv"
. venv/bin/activate
echo "Install dependency"
pip install -r requirements.txt
bower install --allow-root
cp graphspace/settings/docker.py graphspace/settings/production.py
cd /
echo "Changing permissions"
chmod -R 777 /GraphSpace
./GraphSpace/docker_command.sh
You can download and install any packages that can run on Ubuntu 16.04. After setting up the package remember to add commands to start the service in the docker_command.sh
file (sample given above). You will have to commit
the changes you made in the docker container and push
it to docker hub. Read on how to do this here.