Graphileon Docker installation

Docker

Before proceeding with the installation, please install the Docker engine on the system. Instructions on how to install Docker can be found on the official Docker website. The Graphileon Docker image was built with Docker version 3.3 and should be compatible with all later versions.

After installing and running Docker, get the Graphileon Docker image from Docker Hub:

docker pull graphileon/graphileon

Start Graphileon

Graphileon is then started with the following command:

Note: \ means new line, this command useful for first start

docker run -dt \
-p $HTTP_HOST_PORT:$HTTP_DOCKER_PORT \
#OPTIONAL -p $HTTPS_HOST_PORT:$HTTPS_DOCKER_PORT \
#OPTIONAL -v $PERSISTENT:/persistent \
--name graphileon \
graphileon/graphileon

Where:

  • $HTTP_HOST_PORT refers to the port on the host machine that is used to connect to Graphileon.
  • $HTTPS_HOST_PORT [OPTIONAL] refers to the port on the host machine that is used to connect to Graphileon with secure connections.
  • $HTTP_DOCKER_PORT is the port on the Docker machine that Graphileon listens to for HTTP requests. You can set this in config.json. Default 3000
  • $HTTPS_DOCKER_PORT [OPTIONAL] is the port on the Docker machine that Graphileon listens to for HTTPS requests. You can set this in config.json. Default 3001
  • $PERSISTENT: [STRONGLY RECOMMENDED] path to a folder on the host machine where Graphileon will store uploaded files. If it is not set, a Docker-managed directory will be used instead. Mapping the persistent volume to a local directory on the host machine makes it significantly easier to update Graphileon or change the Graphileon configuration file.

Example Run:

mkdir -p ~/graphileon/persistent
docker run -dt \
-p 3000:3000 \
-v ~/graphileon/persistent:/persistent \
--name graphileon \
graphileon/graphileon

On success, expect to see output similar to the following in the docker logs:

To see logs in docker run:

docker logs graphileon

Default logs for first start

[ server/core/config ] Writing config.json because it does not exist: ./persistent/config/config.json
[ server/core/config ] No SSL certificates found. HTTPS will not be available.
[ edition ] Activated Graphileon Personal Edition (gpe).
[ core ] Default log level: WARN.
[ core ] Log level for 'Function' set to 'INFO'.
[ core ] Log level for 'Trigger' set to 'INFO'.
[ core ] Log level for 'function/console' set to 'ALL'.
Server Started

Stop Graphileon

To stop Graphileon, run:

docker kill graphileon

Configuration

You can find the configuration file config.json in the $CONFIG folder.

You should set:

  • port: the $HTTP_DOCKER_PORT port Graphileon server will listen to (inside docker container / vm)

  • https port: the $HTTPS_DOCKER_PORT port Graphileon server will listen to, for example:

      "https" {
      	"port": 3001
      }
    
  • allowedDomains: a list of requesting domains the server is allowed to respond to. Add here http://$SERVER_ADDRESS:$HTTP_HOST_PORT and https://$SERVER_ADDRESS:$HTTPS_HOST_PORT (where $SERVER_ADDRESS is the domain and/or port of the host machine)

The Graphileon Docker container should be restarted after changing the configuration. Stop and rerun as described above.

Set up Graphileon

Graphileon is now ready to be set up. To access Graphileon, point your browser to

https://$SERVER_ADDRESS:$HTTPS_HOST_PORT or http://$SERVER_ADDRESS:$HTTP_HOST_PORT where $SERVER_ADDRESS is the ip or domain name of the host machine and $HTTP_HOST_PORT or $HTTPS_HOST_PORT are the ports configured earlier.

Using a local database

In order to use Graphileon with a local database, you will need to find the IP address that, within the Docker container, refers to your local machine.

If your database runs on the same machine as your Docker instance, the ip address you need enter as database host may differ from machine to machine. Below are the default IP addresses for the most common operation systems and Docker versions:

Note: You can also use host.docker.internal instead of the same machine IP address.

Configuration Docker IP Address Host Machine Ip Address How to find it
Linux/MacOS & Docker Native 172.17.0.2 192.168.x.x Run docker inspect, and find "Gateway" under "NetworkSettings" > "Networks" > "bridge" in the output.
Windows & Docker Native 10.0.75.1 10.0.x.x In PowerShell (or Command Prompt), run ipconfig and look for "Ethernet adapter vEthernet (DockerNAT)".
MacOS & Docker Toolbox 10.0.2.2 10.0.x.x This is the IP address VirtualBox uses to address the host machine from a virtual machine.