Docker Dev/Kamal Deployment - #6
Merged
Merged
Conversation
…and add entrypoint script
…tier for code formatting
… Compose setup for local development
…t development environment
… configuration in Docker setup
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
PR 7: Deployment
Multi-stage Dockerfile, Kamal 2 config, linters, and CI.
Topology: one accessory, no Redis
Solid Queue, Solid Cache and Solid Cable all run on the single Postgres
accessory, as four logical databases. Production is one database container
plus two app roles (
web,job). No Redis anywhere in the stack.config/postgres/init.sqlbootstraps the queue/cache/cable databases; theaccessory only creates the primary.
Job process
Solid Queue runs as a separate Kamal role, not
SOLID_QUEUE_IN_PUMA. In-Pumais one less container, but it puts a 50k-row spreadsheet import in contention
with request threads, which is what the dedicated
importsqueue in PR 5exists to avoid.
Docker
base->build(gems, npm, Vite, bootsnap) -> slim final.npm cicopies onlypackage*.jsonfirst so application changes do notinvalidate the npm layer. Same for the Gemfile.
libvipsover ImageMagick for avatar variant processing.railsuser.SECRET_KEY_BASE=DUMMYduring precompile only. The realRAILS_MASTER_KEYarrives at runtime via Kamal secrets and is never bakedinto a layer;
config/master.keyis in.dockerignore.Active Storage
S3, not a container volume. Local disk loses every uploaded avatar on deploy,
and a volume mount pins the app to one host. Bucket is private; variants are
served through Rails.
Inertia SSR
The SSR bundle is built and shipped but gated behind
INERTIA_SSR_ENABLED,default off. SSR adds a third process and a failure mode where a dead Node
server 500s every page. Documented as opt-in rather than presented as
production-ready.
Linting
rubocop-rails-omakaseas the baseline plusrubocop-rspecand targetedoverrides, rather than a bespoke config. Omakase is the Rails-official
baseline; a hand-rolled 400-line config is a maintenance liability I would not
defend in review. Brakeman and bundler-audit run in CI with non-zero exit on
findings.
tsc --noEmitis included because Vite transpiles TypeScriptwithout type-checking it.
ZJIT
Benchmarked, not assumed. See README for measured rows/sec on a 10k-row import
with ZJIT on, YJIT on, and both off. [Fill in the actual numbers and the
resulting default.]
Test plan
bin/cilocallydocker build .anddocker runagainst a local Postgreskamal setupagainst a staging host, thenkamal deploy