Skip to main content
Deploy KoreShield to Railway using a Docker image from this repo. Railway handles build, deploy, and TLS for you.

Use Cases

  • Fast production deploys with minimal ops
  • Staging environments for LLM policy changes
  • Small to mid-scale workloads with managed hosting

Prerequisites

  • Railway account
  • KoreShield repo or a Docker image in a registry
  • Provider API keys available as Railway variables

Option A: Deploy from GitHub Repo

1

Create Railway Project

Create a new Railway project
2

Connect GitHub Repo

Connect your GitHub repo
3

Select Service

Select the koreshield service
4

Auto-detect Dockerfile

Railway will detect the Dockerfile

Option B: Deploy from a Docker Image

1

Build and Push Image

docker build -t koreshield .
docker tag koreshield:latest <registry>/koreshield:latest
docker push <registry>/koreshield:latest
2

Create Service from Image

In Railway, create a service from the image

Configure Environment Variables

Set environment variables in Railway’s dashboard for secure configuration management.
Set these Railway variables:
OPENAI_API_KEY=your-api-key
KORESHIELD_API_KEY=your-koreshield-api-key
If you use a custom config path:
CONFIG_FILE=/app/config/config.yaml

Mount Config (Optional)

Railway supports volumes. If you mount a config file, make sure the path matches your CONFIG_FILE value.

Health Check

curl https://<railway-domain>/health

Observability

  • Enable json_logs: true for structured logging
  • Scrape /metrics from an internal monitor or a private endpoint
  • Watch Railway logs for startup and provider errors

Security Notes

Never commit API keys to your repository. Always use Railway environment variables.
  • Keep provider keys in Railway variables, not in code
  • Use KORESHIELD_API_KEY to protect access to the proxy
  • Restrict access with a private domain or gateway if needed

Troubleshooting

401 responses: confirm `KORESHIELD_API_KEY` on clients

Next Steps

Build docs developers (and LLMs) love