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

modify docker file for jekyll serve out of the box #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem 'github-pages', group: :jekyll_plugins

gem 'wdm', '>= 0.1.0' if Gem.win_platform?
gem "webrick", "~> 1.8"
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
gem "webrick", "~> 1.8"
10 changes: 3 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ GEM
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
ffi (1.17.0-x64-mingw-ucrt)
ffi (1.17.0-x64-mingw32)
ffi (1.17.0)
forwardable-extended (2.6.0)
gemoji (4.1.0)
github-pages (231)
Expand Down Expand Up @@ -219,8 +218,6 @@ GEM
nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.13.10-x64-mingw32)
racc (~> 1.4)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
Expand Down Expand Up @@ -254,17 +251,16 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (1.8.0)
wdm (0.2.0)
webrick (1.8.1)
zeitwerk (2.6.17)

PLATFORMS
x64-mingw-ucrt
x64-mingw32
x64-unknown
x86_64-linux

DEPENDENCIES
github-pages
wdm (>= 0.1.0)
webrick (~> 1.8)

BUNDLED WITH
Expand Down
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,43 @@ Things to look out for when testing

Before pull requests are merged maintainers should test all aspects of the site.

# Getting started with this site and Jekyll
# Getting started with this site

## What is Jekyll?

Jekyll is a static site generator. It takes text written in your favorite markup language and uses layouts to create a static website. You can tweak the site’s look and feel, URLs, the data displayed on the page, and more.

Quoted from https://jekyllrb.com/docs/

## Docker quickstart
You may run Jekyll to serve the CodeWith website locally via docker

You must first install [Docker](https://www.docker.com/) for your operating system.

Next, you must then build the docker container,
that will install the dependencies required for the application to run. You will need to run this command
at any point the Dockerfile changes to ensure you have the latest version of the container.

```bash
docker build . -f docker/bundle.Dockerfile --tag 'codewithgroup-website'
```

At any point at which you then want to run the server, use

```bash
docker run -it -v .:/app -p 127.0.0.1:4000:4000 codewithgroup-website
```

Despite what the output may say, you will access the CodeWith website at `127.0.0.1:4000`

Changes to files within the project will prompt a recompile after some time, you'll need to refresh the page
you're viewing in the browser to see the changes.

## Jekyll setup

If you're familiar with Ruby gems, run the following:
Provided you have followed the steps above, you may wish to decide to skip this step.

However, if serving via Docker is unsuccessful, and you're familiar with Ruby gems, try running the following:

`gem install bundle`

Expand Down
9 changes: 7 additions & 2 deletions docker/bundle.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
FROM ruby:2.7.1
RUN mkdir /app
COPY . /app/

WORKDIR /app
COPY Gemfile /app/Gemfile

ENTRYPOINT [ "bundle" ]
RUN gem install bundler:2.3.17
RUN bundle install

ENTRYPOINT [ "bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0", "--force_polling"]
EXPOSE 4000