Deployment
Running Mellow in production.
Deployment
Docker
The repository ships a multi-stage Dockerfile that builds a static binary and runs it as a
non-root user on Alpine.
docker build -t mellow .
docker run --env-file .env -p 9420:9420 mellowThe image has no shell entrypoint beyond the binary; pass configuration via --env-file or
-e.
Railpack / Railway
railpack.json defines a Go build and start command:
{
"provider": "go",
"steps": { "build": { "commands": ["go build -trimpath -ldflags \"-s -w -X main.version=${RAILPACK_GIT_SHA:-dev}\" -o bin/mellow ./cmd/mellow"] } },
"deploy": { "startCommand": "./bin/mellow" }
}On Railway (or any Railpack host):
- Create a project and add a PostgreSQL database.
- Set the environment variables (the reference lists them). Point
DATABASE_URLat the database plugin, keepingsslmode=require. - Deploy. Migrations run automatically on boot.
- Expose
PORTif you want the HTTP API reachable; otherwise leave it internal.
Any host
Because Mellow is one binary, any process manager works:
# /etc/systemd/system/mellow.service
[Service]
EnvironmentFile=/opt/mellow/.env
ExecStart=/opt/mellow/mellow
Restart=on-failure
User=mellowVersion stamping
Builds set the version via -ldflags "-X main.version=...". /version and the startup update
check compare this against the latest GitHub release, so set it to your tag or commit SHA.
Deploy pipeline tip
Run migrations as a separate step before rolling out the new binary:
MELLOW_MIGRATE_ONLY=1 ./mellowHTTP API
The API serves:
GET /healthz- health check (unauthenticated)GET /v1/stats- aggregate countsGET /v1/status- live bot and per-shard status (unauthenticated)GET /v1/testimonials- approved testimonialsPOST /v1/chat- chat completion (BearerAPI_TOKEN)POST /v1/feedback- submit feedback (BearerAPI_TOKEN)GET /openapi.jsonandGET /docs- the OpenAPI spec and a Scalar reference
Put it behind a TLS-terminating reverse proxy. See the
.