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 for local dev #500

Open
wants to merge 1 commit into
base: main
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
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/gems
_site
.sass-cache
.jekyll-metadata
.bundle
11 changes: 11 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,14 @@ jobs:

- name: Build & Validate
run: rake validate

docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build container
run: docker-compose build

- name: Build site in container
run: docker-compose run docs rake build
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ruby:2.7

ENV GLOBAL_GEMS=true

WORKDIR /usr/src/website

RUN git config --global --add safe.directory /usr/src/website && git config --global --add safe.directory /usr/src/website/_sass/brand

RUN gem install bundler rake

COPY . ./

RUN rake dependencies

CMD ["rake", "dev"]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The Student Robotics public website.

## Getting Started

For ease of setup, a Docker container is provided. Simply install Docker and `docker-compose`, and run `docker-compose up`.

### Manual

0. [Clone this repo][clone-repo]

1. [Install Ruby 2.7][install-ruby]
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ end
task :submodules => ['_sass/brand/.git']

task :dev => [:dependencies, :submodules] do
sh('bundle exec jekyll serve --drafts --config _config.yml,_dev.yml')
sh('bundle exec jekyll serve --host 0.0.0.0 --drafts --config _config.yml,_dev.yml')
end

task :build => [:dependencies, :submodules] do
Expand Down
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ exclude:
- .github/
- .vscode/
- vendor/
- docker-compose.yml
- Dockerfile

paginate: 3
paginate_path: "/blog/:num/"
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "2.3"

services:
website:
build:
context: .
volumes:
- ".:/usr/src/website"
ports:
- "4000:4000"