Skip to content

Build with Railpack instead of Nixpacks - #259

Open
abe-101 wants to merge 2 commits into
mainfrom
switch-to-railpack
Open

abe-101 wants to merge 2 commits into
mainfrom
switch-to-railpack

Conversation

@abe-101

@abe-101 abe-101 commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Step 1 of moving off deprecated Railway tooling. It switches only the builder: Python stays 3.13 and the start command is unchanged. Railway's build docs now only cover Railpack, and Nixpacks tops out at Python 3.13, so this is also the prerequisite for Python 3.14.

Changes

  • railway.json: "builder": "RAILPACK". Nothing else in the file changes.
  • New railpack.json. Railpack's install step copies only requirements.txt before pip install, for layer caching. Ours just does -r requirements/production.txt, so the build failed in rehearsal with Could not open requirements file. Nixpacks never hit this because it copied the whole repo first. The fix copies the requirements/ folder ahead of Railpack's own install commands; "..." keeps them as generated.
  • Removed the stray my_hebrew_dates/railway.json. It's leftover from the first Railway setup, starts a nonexistent mysite.wsgi, and Railway never read it, because only the root file counts. railway config migrate was treating it as a second service.

Local rehearsal (Railpack CLI 0.40.1 + BuildKit in podman)

  • Detection: Python, pip, Django config.wsgi. Python 3.13 comes from .python-version.
  • Image build: succeeds with railpack.json and fails without it.
  • Start command: ran the built image with the exact start command from railway.json and production settings, against local Postgres and Valkey. migrate, collectstatic, compress and gunicorn on $PORT all succeed.
  • Pages: home, the .ics feed (cold and from the Redis cache), login, signup, admin login and static files all return 200, with no errors in the log.
  • The .ics feed is byte-identical to the same code outside the image, apart from DTSTAMP (the current time), with and without an alarm. Subscribers see no change.

After merge (checked with read-only Railway logs)

  • The build log shows Railpack, not Nixpacks.
  • Startup: "No migrations to apply", static files collected, compress OK, gunicorn up.
  • Real subscriber feed requests return 200 and the app log stays clean.

Rollback: revert this PR, or redeploy the previous deployment in Railway.

Still to come

  • Python 3.14.
  • Moving railway.json to .railway/railway.ts before 2026-12-01, when Railway stops reading railway.json. That step also needs MHD-web's builder setting changed to Railpack, because today railway.json overrides the service's stored NIXPACKS value.

https://claude.ai/code/session_013jv3p3hyCW4rgGJXZMQU13

Railway reads only the railway.json at the repo root. This copy, left
over from the first Railway setup, starts a `mysite.wsgi` module that
doesn't exist. `railway config migrate` treats it as a second service,
so it has to go before moving to Infrastructure as Code.

Assistant-model: Claude Code
Claude-Session: https://claude.ai/code/session_013jv3p3hyCW4rgGJXZMQU13
Railway's build docs only cover Railpack now, and Nixpacks stops at
Python 3.13, so Railpack is the only route to newer Python. The start
command and Python version stay the same; only the builder changes.

Railpack copies just requirements.txt before `pip install`, for layer
caching, but ours includes requirements/production.txt, so the install
failed. railpack.json copies the requirements folder ahead of Railpack's
own install commands ("..." keeps them as they are).

Built and run locally with the Railpack CLI: the start command,
pages, cache and static files work, and the .ics feed is byte-identical
to the current build apart from DTSTAMP.

Assistant-model: Claude Code
Claude-Session: https://claude.ai/code/session_013jv3p3hyCW4rgGJXZMQU13

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant