-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
_posts/ | ||
assets/ | ||
_docs/ | ||
_includes/ | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="intellij-rust.github.io" type="docker-deploy" factoryName="dockerfile" server-name="Docker"> | ||
<deployment type="dockerfile"> | ||
<settings> | ||
<option name="imageTag" value="intellij-rust.github.io" /> | ||
<option name="containerName" value="intellij-rust.github.io" /> | ||
<option name="portBindings"> | ||
<list> | ||
<DockerPortBindingImpl> | ||
<option name="containerPort" value="8080" /> | ||
<option name="hostIp" value="0.0.0.0" /> | ||
<option name="hostPort" value="8080" /> | ||
</DockerPortBindingImpl> | ||
</list> | ||
</option> | ||
<option name="sourceFilePath" value="Dockerfile" /> | ||
<option name="volumeBindings"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The trick here is to preserve 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: And by @vlad20012 advice, I've added all of them to |
||
<list> | ||
<DockerVolumeBindingImpl> | ||
<option name="containerPath" value="/intellij-rust.github.io/_posts/" /> | ||
<option name="hostPath" value="$PROJECT_DIR$/_posts/" /> | ||
<option name="readOnly" value="true" /> | ||
</DockerVolumeBindingImpl> | ||
<DockerVolumeBindingImpl> | ||
<option name="containerPath" value="/intellij-rust.github.io/assets/" /> | ||
<option name="hostPath" value="$PROJECT_DIR$/assets/" /> | ||
<option name="readOnly" value="true" /> | ||
</DockerVolumeBindingImpl> | ||
<DockerVolumeBindingImpl> | ||
<option name="containerPath" value="/intellij-rust.github.io/_docs" /> | ||
<option name="hostPath" value="$PROJECT_DIR$/_docs/" /> | ||
<option name="readOnly" value="true" /> | ||
</DockerVolumeBindingImpl> | ||
<DockerVolumeBindingImpl> | ||
<option name="containerPath" value="/intellij-rust.github.io/_includes" /> | ||
<option name="hostPath" value="$PROJECT_DIR$/_includes/" /> | ||
<option name="readOnly" value="true" /> | ||
</DockerVolumeBindingImpl> | ||
vlad20012 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</list> | ||
</option> | ||
</settings> | ||
</deployment> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM ruby:3.2 | ||
|
||
RUN apt-get update && apt-get install -y build-essential | ||
|
||
COPY . /intellij-rust.github.io | ||
WORKDIR /intellij-rust.github.io | ||
|
||
RUN gem install github-pages jekyll jekyll-feed | ||
RUN bundle add webrick | ||
RUN bundle update | ||
RUN bundle install | ||
vlad20012 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
EXPOSE 8080 | ||
|
||
WORKDIR /intellij-rust.github.io | ||
CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0", "--port", "8080", "--future"] |
Uh oh!
There was an error while loading. Please reload this page.