Deploy railway-image-updater
Trigger multiple docker deployments for a new docker image tag.
railway-image-updater
Just deployed
Deploy and Host railway-image-updater on Railway
Railway Image Updater is a lightweight Go service that automatically updates Docker image tags across multiple Railway services in a single API call. Add one step to your CI/CD pipeline and every service sharing an image — web, worker, cron — gets updated and redeployed together.
About Hosting railway-image-updater
Railway Image Updater runs as a small HTTP service inside your Railway project. It exposes a single PUT /update endpoint that your CI/CD pipeline calls after building a new Docker image. The service queries Railway's API to find all services whose image matches any of the provided prefixes, updates each one to the new tag, preserves replica counts, and triggers a deployment — all in one request. Configuration is minimal: set your RAILWAY_API_TOKEN and optionally provide private registry credentials. A /health endpoint is included for readiness probes.
Common Use Cases
- Deploying worker and cron services that must run the same image version as the web application
- Rolling out a new release across multiple microservices that share a base image
- Automating post-build deployments from GitHub Actions, GitLab CI, or any CI/CD system
Dependencies for railway-image-updater Hosting
- A Railway API token with access to the target project
- A CI/CD pipeline or automation tool that can send HTTP requests after building a new image
Deployment Dependencies
- A Railway project with one or more services using Docker images you want to keep in sync
- Railway CLI (optional, for local development and testing)
Implementation Details
Endpoint: PUT /update
Request body:
{
"project_id": "550e8400-e29b-41d4-a716-446655440000",
"environment_id": "4a744664-7c0a-4806-8cae-a07c6868179c",
"image_prefixes": ["docker.io/myorg/myapp"],
"new_version": "v1.2.3"
}
| Field | Type | Description |
|---|---|---|
project_id | UUID | Your Railway project ID |
environment_id | UUID | The environment to update (e.g. production, staging) |
image_prefixes | string[] | Image name prefixes to match — any service whose image starts with one of these will be updated |
new_version | string | The new image tag to apply (e.g. v1.2.3, sha-abc123) |
Response:
{
"message": "Successfully updated 2 service(s)",
"updated_services": ["api", "worker"]
}
Example CI/CD step (GitHub Actions):
- name: Update Railway services
run: |
curl -X PUT https://your-updater.railway.app/update \
-H "Content-Type: application/json" \
-d '{
"project_id": "${{ vars.RAILWAY_PROJECT_ID }}",
"environment_id": "${{ vars.RAILWAY_ENV_ID }}",
"image_prefixes": ["docker.io/myorg/myapp"],
"new_version": "${{ github.sha }}"
}'
Environment variables:
| Variable | Required | Description |
|---|---|---|
RAILWAY_API_TOKEN | Yes | Railway API token |
PORT | No | Server port (default: 8080) |
RAILWAY_DOCKER_REGISTRY_USER | No | Username for private Docker registries |
RAILWAY_DOCKER_REGISTRY_TOKEN | No | Token/password for private Docker registries |
Source: github.com/returnearly/railway-image-updater
Why Deploy railway-image-updater on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying railway-image-updater on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
railway-image-updater
ghcr.io/returnearly/railway-image-updater:latestRAILWAY_API_TOKEN
Railway API Token to update services.
