Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile to deployment options #626

Merged
merged 2 commits into from
Sep 23, 2022
Merged

Add Dockerfile to deployment options #626

merged 2 commits into from
Sep 23, 2022

Conversation

stephendolan
Copy link
Contributor

@stephendolan stephendolan commented Sep 16, 2022

This is a 🔦 documentation change.

Summary

This PR adds documentation for Dockerfile-based deployments, which should cover a huge number of additional deployment options (Fly.io, Render/Heroku without buildpacks, Railway, etc).

Context

This uses a multi-stage build that I've confirmed to work with my (relatively simple) personal site on Fly.io(https://stephen-dolan.fly.dev). There are a few advantages to multi-stage builds:

  • Your final production image is super small, and doesn't have to contain ruby or nodejs runtimes.
  • You can compile JS and Ruby output separately to keep those respective images really clean. No mucking around with installing nodejs package signatures and specifying hard-coded versions in the ruby:alpine image.

I'd welcome any tips regarding how to more effectively/minimally build a site for production use. I think there's value in keeping the Dockerfile simple enough for folks to run with and modify on their own, but even some comments with potential alternatives for folks running different setups (like webpack) might be nice!

This means your site is running as an app, so it's more expensive than running a free static site that many services (Netlify, Render, etc) can detect. That said, it gives you tons of flexibility and a lot more options for providers.

@jaredcwhite
Copy link
Member

Thanks @stephendolan!

@jaredcwhite jaredcwhite merged commit 45ab0ef into bridgetownrb:main Sep 23, 2022
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.

2 participants