Skip to content

Deploy API to Railway #100

@JohnRDOrazio

Description

@JohnRDOrazio

Goal

Ship the OntoKit API on Railway so we have a low-cost hosted deployment.

Blocker hit

Railway's free/hobby tier caps build images at 4 GB. The existing Dockerfile.prod produced an image > 5 GB, so the build step failed.

Root cause

  • sentence-transformers is a core dependency, pulling in PyTorch + transformers + scipy (~2–3 GB).
  • Dockerfile.prod was single-stage, so pip cache, build tools, and libgit2-dev headers all ended up in the final image.
  • The Dockerfile also pre-downloaded the all-MiniLM-L6-v2 model (~90 MB + cache) at build time.

Work

  • Shrink the image to fit Railway's 4 GB cap — see chore(docker): shrink prod image from >5GB to ~606MB for Railway #101
  • Provision the dependent services on Railway (see comment below)
  • Wire env vars (DATABASE_URL, REDIS_URL, MINIO_*, ZITADEL_*, SECRET_KEY, …) into the Railway API service
  • Verify DB migrations run cleanly on first boot via scripts/entrypoint.sh
  • Verify pgvector extension is available on the chosen Postgres
  • End-to-end smoke test: auth → project CRUD → embedding query

Metadata

Metadata

Assignees

No one assigned

    Labels

    deploymentDocker, CI/CD, and deployment configurationenhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions