Skip to content

Commit

Permalink
Merge pull request #271 from kchason/local-docker-development
Browse files Browse the repository at this point in the history
Local Docker Build
  • Loading branch information
regriff authored Jan 23, 2024
2 parents 7520d0f + 34b714d commit b6804d9
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 1 deletion.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM --platform=linux/amd64 ruby:3.1-bullseye

# Define the working directory
WORKDIR /usr/app/src

# Copy the Gemfile and Gemfile.lock
COPY Gemfile Gemfile.lock ./

# Install dependencies
RUN gem install jekyll bundler &&\
bundle install

# Expose port 4000 and the 35729 for livereload
EXPOSE 4000
EXPOSE 35729

# Start the application
CMD ["bundle", "exec", "jekyll", "serve", "--livereload", "--host", "0.0.0.0"]
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0" if Gem.win_platform?

# For Ruby >= 3.0.0, install gem "webrick" to prevent error
# Source: https://github.com/github/pages-gem/issues/752
gem "webrick", "~> 1.7"
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ GEM
nokogiri (1.15.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
Expand Down Expand Up @@ -261,16 +263,19 @@ GEM
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (1.8.0)
webrick (1.8.1)

PLATFORMS
ruby
x86_64-linux

DEPENDENCIES
github-pages
jekyll-feed
jekyll-seo-tag
jekyll-sitemap
tzinfo-data
webrick (~> 1.7)

BUNDLED WITH
2.1.4
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
## Official repo of the CASE Ontology Website
## Official Repository of the CASE Ontology Website

This repository serves the website for https://caseontology.org.

To report an issue with or make suggestions for the website, please visit the [CASE Community Help Center](https://case.atlassian.net/servicedesk).

If you are interested in contributing to the website and require a local environment for testing modifications, see [CONTRIBUTE.md](https://github.com/casework/casework.github.io/blob/master/CONTRIBUTE.md).

### Local Development

This repository is configured with a Docker Compose file to allow for local development. To run the website locally, you will need to install [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/).

Once Docker and Docker Compose are installed, you can run the following command to start the website locally:

```bash
docker-compose up -d --build
```

The website will be available at http://localhost:4000 and should automatically reload when changes are made to the source files as it is running in watch mode.

To stop the website, run the following command:

```bash
docker-compose down
```

To troubleshoot the website, you can view the logs with the following command:

```bash
docker logs jekyll
```
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ exclude:
- releases/0.2.0/migration/Makefile
- requirements.txt
- venv/
- Dockerfile
- docker-compose.yml

# Google Analytics
google_analytics: UA-158161373-1
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.8'

services:
jekyll:
container_name: jekyll
build: .
ports:
- "4000:4000"
- "35729:35729"
volumes:
- .:/usr/app/src/

0 comments on commit b6804d9

Please sign in to comment.