Deploying Gephi Lite
You can easily deploy Gephi Lite in your environment.
This guide explains several ways to do it.
Using Docker
We provide an official Docker image of Gephi Lite: Docker Hub - ouestware/gephi-lite
The image contains a built version of Gephi Lite, served by Nginx on port 80
.
To use it, open your terminal and run the following commands:
docker pull ouestware/gephi-lite:latest
docker run --name gephi-lite -d -p 80:80 ouestware/gephi-lite:latest
Then open http://localhost in your browser.
Build from Source
Gephi Lite is a React application. To build it, you need npm and Git installed on your computer.
- Clone the repository:
git clone https://github.com/gephi/gephi-lite.git
cd gephi-lite
- Install dependencies:
npm install
- Build the project:
export BASE_URL=/ && npm run build
By default, the build process creates a website that must be served under the /gephi-lite
path (e.g. http://localhost/gephi-lite/).
In the example above, we set the environment variable BASE_URL
to /
so the application can be served at the root of the domain.
You can adjust it to any path you prefer.
- The static files of the Gephi Lite application are built in the folder:
./packages/gephi-lite/build/
You can copy these files to any location, for example /var/www/html/gephi-lite
or start a web server in this directory:
With python
python -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
With NPM
npx http-serve
Starting up http-serve for ./
Available on:
http://127.0.0.1:8081
- Configure your web server (Apache, Nginx, etc.) to serve this folder.
Here’s an Nginx example:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
# Replace this location with the one where you placed the Gephi Lite files
root /var/www/html/gephi-lite;
# Required for React applications
location / {
try_files $uri $uri/ =404;
}
# For GitHub authentication to work
# We need to create a GitHub proxy to `https://github.com/login` that accepts CORS
location /_github/login {
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, user-agent";
if ($request_method = OPTIONS) {
return 204;
}
proxy_pass https://github.com/login;
}
}