Spray Minimal GCS Static File Server

A lightweight, production-ready Go web server that serves static files directly from Google Cloud Storage buckets. Simple to deploy, easy to configure, and built for performance.

Deploy with Docker
# Build the image
docker build -t spray .

# Run with your GCS bucket
docker run -e BUCKET_NAME=my-bucket \
  -p 8080:8080 spray

Why Choose Spray?

Lightning Fast

Minimal overhead with direct GCS integration. Serve your static files with blazing speed and low latency.

📊

Production Metrics

Comprehensive Prometheus metrics for monitoring request volume, latency, errors, and GCS operation performance.

🔄

Smart Redirects

Configure custom redirects with a simple TOML file. Perfect for URL migrations and traffic routing.

🛡️

Built-in Security

Path traversal protection, proper error handling, and secure defaults out of the box.

🔍

Health Checks

Ready-made health check endpoints for Kubernetes and other orchestration platforms.

⚙️

Easy Configuration

Simple environment variable configuration. No complex setup required.

Getting Started

1

Set Environment Variables

Configure your GCS bucket and Google Cloud project:

export BUCKET_NAME=my-static-site
export GOOGLE_PROJECT_ID=my-project
export PORT=8080  # Optional, defaults to 8080
2

Deploy with Docker

The easiest way to get started:

docker run -e BUCKET_NAME=my-bucket \
  -e GOOGLE_PROJECT_ID=my-project \
  -p 8080:8080 \
  ghcr.io/picotechllc/spray:latest
3

Or Build from Source

Build and run locally:

git clone https://github.com/picotechllc/spray.git
cd spray
go build
./spray

Documentation

📝 Configuration

Learn how to configure Spray with environment variables and redirect files.

  • Environment variables
  • Custom redirects with TOML
  • Port configuration

📈 Metrics & Monitoring

Comprehensive metrics for production monitoring and observability.

  • Prometheus metrics at /metrics
  • Request volume and latency
  • Error tracking and GCS performance

🚀 Deployment

Deploy Spray to various platforms and environments.

  • Docker deployment
  • Kubernetes configurations
  • GCP Cloud Run

Available Endpoints

GET / Serves static files from GCS bucket
GET /metrics Prometheus metrics endpoint
GET /readyz Readiness probe endpoint
GET /livez Liveness probe endpoint