Repository navigation
Deploy to Render as one Docker service - #6
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:public/./cablefrom one service on one URL.render.yamlis a Blueprint for one free Docker web service:/upand generatesSECRET_KEY_BASE.WEB_CONCURRENCY=0, which keeps it to one Puma process.FrontendControllerserves the page at/withno-cache, so a new deploy shows up right away. The hashed JS and CSS files keep the one-year cache.asyncadapter in production instead of Redis. That works because there's only one process.storage/production.sqlite3, andbin/docker-entrypointrunsdb:prepareon boot./upis 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
mainthen deploys again.Checks
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./up,/and the API all respond.RunChanneland 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/rubocopis clean, andbin/brakemanreports 0 warnings.npm run lintandnpm run buildboth pass.