Skip to content

Deploy to Render as one Docker service - #6

Merged
royalpriest merged 2 commits into
mainfrom
feat/render-deploy
Nov 21, 2026
Merged

royalpriest merged 2 commits into
mainfrom
feat/render-deploy

Conversation

@royalpriest

@royalpriest royalpriest commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

This sets the app up to run on Render. It adds a screenshot to the README and a deploy section to go with it.

How it runs

  • Dockerfile (repo root) builds in two stages:
    • Node builds the Vite frontend into public/.
    • Ruby 3.3.14 runs Rails, which serves the frontend, the API and /cable from one service on one URL.
  • render.yaml is a Blueprint for one free Docker web service:
    • It runs a health check on /up and generates SECRET_KEY_BASE.
    • It sets WEB_CONCURRENCY=0, which keeps it to one Puma process.
  • FrontendController serves the page at / with no-cache, so a new deploy shows up right away. The hashed JS and CSS files keep the one-year cache.
  • Action Cable uses the async adapter in production instead of Redis. That works because there's only one process.
  • SQLite is stored at storage/production.sqlite3, and bin/docker-entrypoint runs db:prepare on boot.
    • The free plan has no persistent disk, so saved runs are lost on each deploy. That's fine for a simulator.
    • The README explains how to keep runs with a paid disk.
  • /up is excluded from the HTTPS redirect, so Render's health check gets a 200.

Setting it up on Render

After this merges, go to New > Blueprint in Render and pick this repo. Every push to main then deploys again.

Checks

  • New CI job docker: builds the image, starts it, and checks /up, / and /api/scenarios. I couldn't run Docker locally, so this job is the first real build of the image.
  • I ran Rails in production mode locally with the built frontend:
    • /up, / and the API all respond.
    • A WebSocket client subscribed to RunChannel and received the broadcast after a tick, so the async adapter works.
  • bin/rails test: 43 runs, 0 failures. Two of them are new tests for the frontend route.
  • bin/rubocop is clean, and bin/brakeman reports 0 warnings.
  • npm run lint and npm run build both pass.

Add a Dockerfile that builds the React frontend and serves it from Rails,
a render.yaml Blueprint for the free plan, and a CI job that builds and
starts the image. Action Cable uses the async adapter in production, so
no Redis is needed. The README gets a screenshot and deploy steps.
An ARG declared inside one stage isn't visible to a later FROM, so the
Ruby image name came out as ruby:-slim.
@royalpriest
royalpriest merged commit 20c57e4 into main Nov 21, 2026
3 checks passed
@royalpriest
royalpriest deleted the feat/render-deploy branch November 22, 2026 16:08
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