Signia ships with every file Railway needs to perform a fully automated deployment. When you push to GitHub, Railway picks up theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jtapieromalambo-ctrl/Signia/llms.txt
Use this file to discover all available pages before exploring further.
Procfile to know how to start the server, nixpacks.toml to install system-level libraries, build.sh to prepare the application, and runtime.txt to pin the Python version — no additional configuration files are required. The sections below explain what each file does, then walk you through connecting your repository and setting the required environment variables.
Configuration Files
Railway’s Nixpacks builder reads four files at the project root to orchestrate the entire build and run cycle.Procfile
TheProcfile defines the two process types Railway executes. The web entry starts Gunicorn and binds it to the port provided by Railway’s $PORT environment variable. The release entry runs Django migrations after every successful build, before traffic is shifted to the new deployment.
--timeout 120 flag is important: MediaPipe landmark extraction and Whisper audio transcription can each take several seconds, so the default 30-second Gunicorn worker timeout would kill long-running requests.
build.sh
build.sh is the build script Nixpacks runs once the system dependencies have been installed. It installs Python packages, gathers static files into /staticfiles/, and runs the initial database migration.
set -o errexit directive causes the script to abort immediately if any command exits with a non-zero status, preventing a partially built container from going live.
nixpacks.toml
nixpacks.toml lists the APT packages that must be present before Python packages are installed. OpenCV and MediaPipe require shared libraries that are not available in a bare Ubuntu container.
| Package | Why it’s needed |
|---|---|
libgl1 | OpenCV’s core rendering dependency |
libglib2.0-0 | GLib runtime required by OpenCV and MediaPipe |
libgl1-mesa-glx | Mesa OpenGL for headless environments |
ffmpeg | Audio decoding for faster-whisper (STT) |
runtime.txt
runtime.txt locks the Python interpreter version. Nixpacks reads this file and provisions exactly the requested release.
Deploying to Railway
Create a Railway project
Log in to railway.app and click New Project. Choose Deploy from GitHub repo if your code is already on GitHub, or select Empty Project and push the code manually via the Railway CLI.
Connect your GitHub repository
Authorize Railway to access your GitHub account, then select the Signia repository. Railway will watch the default branch and trigger a new deployment on every push.
Add environment variables
Navigate to your service → Variables and add the following key-value pairs. Railway injects these into every build and runtime environment.
| Variable | Example value | Purpose |
|---|---|---|
SECRET_KEY | django-insecure-... | Django cryptographic secret |
DEBUG | False | Disables debug mode in production |
DATABASE_URL | postgresql://user:pass@host.neon.tech/signia?sslmode=require | Neon PostgreSQL connection string |
GROQ_API_KEY | gsk_... | LSC grammar conversion via Groq |
BREVO_API_KEY | xkeysib-... | Transactional email delivery |
EMAIL_HOST_USER | you@gmail.com | Sender address for outbound mail |
EMAIL_HOST_PASSWORD | app-password | Gmail application password |
RAILWAY_PUBLIC_DOMAIN | signia.up.railway.app | Sets ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS |
RAILWAY_PUBLIC_DOMAIN is read by settings.py to dynamically append your deployment’s hostname to both ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS. Without it, every POST request — including login and translation — will return a 403 CSRF error.Railway auto-detects Procfile and nixpacks.toml
As soon as a build is triggered, Railway’s Nixpacks builder scans the repository root. It finds
nixpacks.toml and installs libgl1, libglib2.0-0, libgl1-mesa-glx, and ffmpeg via APT before any Python work begins. It then finds the Procfile and registers the web and release process types automatically — no manual service configuration is required.build.sh runs
Nixpacks executes
build.sh during the build phase. In order, it:- Installs all Python packages from
requirements.txt - Runs
python manage.py collectstatic --no-input --clearto copy all static assets (CSS, JS, MediaPipe WASM bundles) into/staticfiles/ - Runs
python manage.py migrateto apply any pending database migrations
release command in the Procfile runs python manage.py migrate once more to handle migrations that depend on the live database state.