Skip to content

[T4] Railway deploy config + CI/CD #4

@langoustine69

Description

@langoustine69

TaskMarket Bounty: $5 USDC

Summary

Set up Queryx for one-command Railway deployment with proper health checks, env var management, and GitHub Actions CI.

Deliverables

1. Dockerfile

FROM oven/bun:1 AS base
WORKDIR /app
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile
COPY . .
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
  CMD curl -f http://localhost:3000/health || exit 1
CMD ["bun", "run", "src/index.ts"]

2. railway.json

{
  "$schema": "https://railway.app/railway.schema.json",
  "build": { "builder": "DOCKERFILE" },
  "deploy": {
    "healthcheckPath": "/health",
    "healthcheckTimeout": 10,
    "restartPolicyType": "ON_FAILURE",
    "restartPolicyMaxRetries": 3
  }
}

3. .env.example

Document all required environment variables with descriptions and example values.

4. DEPLOY.md

Step-by-step Railway deployment guide:

  • Install Railway CLI
  • railway login
  • railway init
  • Set env vars via dashboard
  • railway up
  • Custom domain setup (queryx.run)

5. .github/workflows/ci.yml

GitHub Actions CI pipeline:

  • Trigger: push to main + pull requests
  • Steps:
    1. Install Bun
    2. bun install
    3. bun test
    4. Type check (bun run tsc --noEmit)
  • Badge in README

6. scripts/smoke-test.sh

Post-deploy smoke test:

#!/bin/bash
# Tests /health returns 200
# Tests /v1/search returns 402 without payment
# Tests PAYMENT_REQUIRED response has proper x402 headers

Acceptance Criteria

  • docker build succeeds locally
  • railway up deploys successfully
  • /health returns { status: "ok" } with 200
  • CI passes on clean repo clone
  • .env.example documents all vars with descriptions
  • DEPLOY.md covers full deployment from zero
  • Smoke test script exits 0 on healthy deployment

Metadata

Metadata

Assignees

No one assigned

    Labels

    infraInfrastructure & DevOpstaskmarketBounty on TaskMarket

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions