-
Notifications
You must be signed in to change notification settings - Fork 29
Feature gh#91 development environment setup with docker #99
Changes from 5 commits
f4edc9f
a4f60c6
a0223a6
22d1861
d538dc2
88e41f2
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,2 @@ | ||
!Gemfile | ||
!Gemfile.locks |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM ruby:2.7.0-alpine3.11 | ||
maxcapraro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
WORKDIR /InnerSource | ||
ADD Gemfile . | ||
ADD Gemfile.lock . | ||
|
||
# Required in order to build gem native extenstions | ||
# see https://github.com/docker-library/ruby/issues/163 | ||
RUN apk add --no-cache g++ gcc make musl-dev | ||
|
||
# Required to build in Docker for Mac, otherwise it will raise the | ||
# error: Could not find 'bundler' | ||
RUN bundle update --bundler | ||
|
||
RUN bundle install | ||
|
||
# Required so that Jekyll will not override site.url with the host passed by --host | ||
ENV JEKYLL_ENV=docker | ||
|
||
EXPOSE 35729 | ||
maxcapraro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
EXPOSE 4000 | ||
|
||
# On --host 0.0.0.0 | ||
# It is required so that Jekyll will accept connections outside of localhost and 127.0.0.1 | ||
CMD jekyll serve --host 0.0.0.0 --livereload --config /source/_config.yml,/source/_config_dev.yml -s /source |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This file is needed for setting up the development environment | ||
# with docker toolbox. | ||
# It reverts the absolute paths configured in _config_dev.yml | ||
# Without this, assets and links build with site.url would fail to | ||
# load or open. | ||
|
||
url: '' | ||
urlimg: 'images/' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: "3.7" | ||
maxcapraro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
services: | ||
jekyll: | ||
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. Both My suggestion is to not have two nearly redundant setups but rather use only one 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. Saw this too late:
For me it worked well with both (just, obviously without the live reload). Do you expect any adverse effects when only having this compose environment? 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. May I ask if you are testing with Docker for Windows (https://docs.docker.com/docker-for-windows/) or Docker Toolbox (https://docs.docker.com/toolbox/toolbox_install_windows/)? As your screenshots show https://localhost:4000, unless you tweaked something, I guess you are using Docker for Windows. The first one is not support on windows home version. I will elaborate on the difference and why there are separate files on my next comment. 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. Ok, so, in more details now. When you are using docker toolbox (not to be confused with docker for windows), the services running on docker will not be available at We have many links that are being generated, for no apparent reason, with an absolute url (site.url + something) - see #102 . If you see the content of I could not understand why Removing the url configuration from To wrap it up, this is the main reason to have separate This is rather confusing, I hope to have explained it in a minimally understandable format 😃 . 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. I see. Thanks for the very detailed explanation :) I would like to enable more people to contribute to the website with minimal fear. That's why I would follow your suggestion:
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. @cewilliams @lenucksi Is that approach allright with you? 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. Cleaning non-relative links and other cases of hard-coded stuff up is always a good idea. 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. Hi @lenucksi , I am not sure what you mean with this approach will not be mandatory, but removing all the non-relative links are not a pre-condition to make this PR work. 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. I was refering to "Editing only using Docker" which still works without, I give this 👍 |
||
build: . | ||
image: innersource-website-devenv | ||
ports: | ||
- "4000:4000" # webpage | ||
- "35729:35729" # live reload | ||
volumes: | ||
- ./:/source | ||
# --force_polling is necessary as the sharing of the filesystem from host to the toolbox vm does not seem to trigger the regular rebuild on changes | ||
# _config_dev_toolbox.yml - see the comments on the file | ||
command: jekyll serve --host 0.0.0.0 --force_polling --livereload --config /source/_config.yml,/source/_config_dev.yml,/source/_config_dev_toolbox.yml -s /source |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: "3.7" | ||
maxcapraro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
services: | ||
jekyll: | ||
build: . | ||
image: innersource-website-devenv | ||
ports: | ||
- "4000:4000" # webpage | ||
- "35729:35729" # live reload | ||
volumes: | ||
- ./:/source |
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.
(Not specific to the
.dockerignore
file)I suggest we also adapt the
CONTRIBUTING.md
file to explain the new development and contribution workflow. This way prospective contributors will learn that (and how) they can make use of this setup.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.
I feel the
CONTRIBUTING.md
is a better fit thanREADME.md
because nobody wants to run the website locally for fun, but rather as a pre-step to contributing to it?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 section should probably include information like:
innersource-website-devenv
http://localhost:4000
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.
Documentation also part of #91 , you will see a unchecked task there exactly because I wanted to follow this up, but I wanted to have a review of the functionality before documenting it :D
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.
That's a legit decision. Now that most discussions are resolved, let's add the documentation? :))