-
Notifications
You must be signed in to change notification settings - Fork 21
Add Docker deployment #175
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
Conversation
</list> | ||
</option> | ||
<option name="sourceFilePath" value="Dockerfile" /> | ||
<option name="volumeBindings"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand, volumes here are needed to be able to apply changes made locally without rerunning configuration. But why only _posts
and assets/posts/
directories? What if I want to change some other places? Maybe it's better to add volume for the whole project directory instead of copying its files during docker image building?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trick here is to preserve Gemfile
and Gemfile.lock
that were patched during the image build. I couldn't find a better way to do that, but if you know one – please share it.
As we can see at https://pages.github.com/versions, GitHub uses Ruby 2.7.4. But I cannot deploy the website locally using this Ruby version on my ARM-based machine because of some dependencies incompatibilities. That's why my Dockerfile uses a newer Ruby version and thus has to patch the gem dependencies to make it work.
I've extended the list of directories: _posts/
, assets/
, _docs/
, _includes/
. They seem to be the most important directories for changes to be auto-applied.
And by @vlad20012 advice, I've added all of them to .dockerignore
not to do the useless job, and I've also fixed the Ruby version to avoid incompatibilities in the future.
c4872d8
to
9cfa608
Compare
@vlad20012 Thanks for the careful review! |
Reduce the image size to 1Gb, mount `_site` for better caching, reduce the number of docker image layers
cbc7e78
to
3075ad9
Compare
No description provided.