Documentation Index
Fetch the complete documentation index at: https://mintlify.com/renja-g/RiftRelay/llms.txt
Use this file to discover all available pages before exploring further.
The recommended way to deploy RiftRelay is using Docker. Pre-built images are available on Docker Hub.
Quick Start
Pull the image
docker pull renjag/riftrelay:latest
Run the container
docker run -d \
--name riftrelay \
-p 8985:8985 \
-e RIOT_TOKEN="your-riot-token" \
renjag/riftrelay:latest
Verify it's running
curl http://localhost:8985/healthz
Configuration
Environment Variables
Pass environment variables using the -e flag:
docker run -d \
--name riftrelay \
-p 8985:8985 \
-e RIOT_TOKEN="your-riot-token" \
renjag/riftrelay:latest
The RIOT_TOKEN environment variable is required. All other configuration options have sensible defaults.
Port Mapping
The default port is 8985. Map it to a different host port if needed:
# Map to port 3000 on host
docker run -d -p 3000:8985 -e RIOT_TOKEN="your-token" renjag/riftrelay:latest
Health Checks
The Docker image includes a built-in health check that runs every 15 seconds:
HEALTHCHECK --interval=15s --timeout=3s --start-period=20s --retries=3 \
CMD wget --spider -q "http://127.0.0.1:${PORT:-8985}/healthz" || exit 1
Check container health:
The STATUS column will show healthy or unhealthy.
Dockerfile Breakdown
Understanding the Dockerfile helps you customize builds and troubleshoot issues.
Multi-Stage Build
The Dockerfile uses a multi-stage build for optimal image size and security:
# syntax=docker/dockerfile:1.7
ARG GO_VERSION=1.26.0
FROM golang:${GO_VERSION}-alpine AS builder
WORKDIR /src
ARG TARGETOS=linux
ARG TARGETARCH
COPY go.mod ./
RUN --mount=type=cache,target=/go/pkg/mod go mod download
COPY . .
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -trimpath -ldflags="-s -w -buildid=" -o /out/riftrelay .
Security Features
- Non-root user: Runs as dedicated
app user with no login shell
- Minimal base: Uses Alpine Linux for reduced attack surface
- Static binary: CGO disabled for better portability and security
- Stripped binary:
-ldflags="-s -w" removes debug info to reduce size
The container runs as a non-root user. Ensure any volume mounts have appropriate permissions.
Build Optimizations
- Build cache: Uses Docker BuildKit cache mounts for faster rebuilds
- Layer caching: Dependencies downloaded separately for better cache reuse
- Trimmed paths:
-trimpath flag ensures reproducible builds
- Small size: Final image is ~20MB
Production Usage
Restart Policies
docker run -d \
--name riftrelay \
--restart unless-stopped \
-p 8985:8985 \
-e RIOT_TOKEN="your-token" \
renjag/riftrelay:latest
Resource Limits
docker run -d \
--name riftrelay \
--restart unless-stopped \
--memory="512m" \
--cpus="1.0" \
-p 8985:8985 \
-e RIOT_TOKEN="your-token" \
renjag/riftrelay:latest
Logging
View container logs:
# Follow logs
docker logs -f riftrelay
# Last 100 lines
docker logs --tail 100 riftrelay
# With timestamps
docker logs -t riftrelay
For production deployments, consider using Docker Compose for easier configuration management. See Docker Compose Deployment.
Container Management
Starting and Stopping
# Stop container
docker stop riftrelay
# Start container
docker start riftrelay
# Restart container
docker restart riftrelay
# Remove container
docker rm -f riftrelay
Updating
Pull latest image
docker pull renjag/riftrelay:latest
Stop and remove old container
docker stop riftrelay
docker rm riftrelay
Start new container
docker run -d \
--name riftrelay \
--restart unless-stopped \
-p 8985:8985 \
-e RIOT_TOKEN="your-token" \
renjag/riftrelay:latest
Troubleshooting
Container won’t start
Check logs for errors:
Common issues:
- Missing
RIOT_TOKEN environment variable
- Port 8985 already in use on host
- Insufficient permissions
Health check failing
Inspect health check status:
docker inspect --format='{{json .State.Health}}' riftrelay | jq
Port binding issues
Check if port is already in use:
# Linux/macOS
lsof -i :8985
# Or use a different port
docker run -d -p 9000:8985 -e RIOT_TOKEN="your-token" renjag/riftrelay:latest