diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..9f93ae48 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +/gems +_site +.sass-cache +.jekyll-metadata +.bundle diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..f01bdab9 --- /dev/null +++ b/Dockerfile @@ -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:~>1' rake + +COPY . ./ + +RUN rake dependencies + +CMD ["rake", "dev"] diff --git a/README.md b/README.md index 6107af27..b560fa27 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,12 @@ 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`. + +Once setup, the site will be accessible on http://localhost:4000/docs/ + +## Manual + 0. [Clone this repo][clone-repo] 1. [Install Ruby 2.7][install-ruby] diff --git a/Rakefile b/Rakefile index 07577d6b..af1a844c 100644 --- a/Rakefile +++ b/Rakefile @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..25a3b306 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: "2.3" + +services: + docs: + build: + context: . + volumes: + - ".:/usr/src/website" + ports: + - "4000:4000"