Nomploy Nomad Packs

← All packs

dgraph v0.1.0

Databases

Dgraph — a distributed, horizontally scalable graph database with a native GraphQL API and its own query language (DQL). Deployed as a single host-networked Nomad service (standalone: Zero + Alpha in one container).

nomad-pack run dgraph --registry nomploy
…or one line (add registry + run)
curl -fsSL https://packs.nomploy.com/install.sh | sh -s -- dgraph

Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.

1 task http 8080grpc 9080 1 volume image dgraph/standalone:latest tracks :latest image bumped today
Variables 9
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run dgraph -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "dgraph"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# The Dgraph standalone container image. Pin a tag in production.
image = "dgraph/standalone:latest"

# Host port for the Alpha HTTP / GraphQL API.
http_port = 8080

# Host port for the Alpha gRPC API (client libraries).
grpc_port = 9080

# Named volume for Dgraph data (/dgraph).
data_volume = "dgraph_data"

# Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# The task resources.
resources = {
    cpu    = 1000
    memory = 2048
  }
NameTypeDefaultDescription
job_name string
"dgraph"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"dgraph/standalone:latest"
The Dgraph standalone container image. Pin a tag in production.
http_port number
8080
Host port for the Alpha HTTP / GraphQL API.
grpc_port number
9080
Host port for the Alpha gRPC API (client libraries).
data_volume string
"dgraph_data"
Named volume for Dgraph data (/dgraph).
constraints list
[]
Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 1000
    memory = 2048
  }
The task resources.
Back up this pack

This pack stores data in one Docker named volume: dgraph_data

restic

# Run on the node hosting this pack. Point restic at your repo first:
#   export RESTIC_REPOSITORY="s3:https://<account>.r2.cloudflarestorage.com/<bucket>"
#   export RESTIC_PASSWORD="<repo-password>"
#   export AWS_ACCESS_KEY_ID=<key>  AWS_SECRET_ACCESS_KEY=<secret>
restic backup \
  /var/lib/docker/volumes/dgraph_data/_data

rclone (sync to S3/R2)

rclone sync /var/lib/docker/volumes/dgraph_data/_data backup:<bucket>/dgraph_data

Paths assume the default Docker volume location (/var/lib/docker/volumes). Restore by stopping the job, restoring files into the same volume, and re-running the pack.

Readme

dgraph

Dgraph is a distributed, horizontally scalable graph database. It serves a native GraphQL API (no resolvers to write) alongside its own graph query language (DQL), with ACID transactions, full-text/geo indexing and a sharded, replicated storage engine designed for large graphs.

This pack runs the standalone Dgraph image (Zero + Alpha bundled in one container) as a single host-networked Nomad service — ideal for a single node.

Deploy

nomad-pack run dgraph --registry=nomploy

Load a schema and query:

curl -X POST http://<node-ip>:8080/admin/schema --data-binary 'type Person { name: String! @index(term) }'
curl -X POST http://<node-ip>:8080/graphql -H 'Content-Type: application/json' -d '{"query":"{ queryPerson { name } }"}'

Configuration

Variable Default Description
image dgraph/standalone:latest Container image (pin a tag in production).
http_port 8080 Alpha HTTP / GraphQL API.
grpc_port 9080 Alpha gRPC API (client libraries).
data_volume dgraph_data Volume for data (/dgraph).
resources 1000 MHz / 2048 MB CPU and memory for the task.

The standalone image bundles Dgraph Zero and Alpha for single-node use. For a production cluster (replication, sharding), deploy Zero and Alpha as separate jobs. Data persists in data_volume.