Skip to content
This repository was archived by the owner on Sep 16, 2025. It is now read-only.
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 @@
.git
.gitignore
.dockerignore
_site/
.bundle/README.md
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Stage 1: The Builder Environment
FROM ruby:3.2.2 AS builder

# Set the working directory inside the container
WORKDIR /usr/src/app

# Install dependencies required to build the site
# Try Alpine's apk first; fall back to Debian's apt-get if apk isn't available.
RUN set -eux; \
if command -v apk >/dev/null 2>&1; then \
apk add --no-cache build-base; \
elif command -v apt-get >/dev/null 2>&1; then \
apt-get update && apt-get install -y build-essential; \
else \
echo 'No supported package manager found (apk or apt-get)'; exit 1; \
fi

# Copy the Gemfile and Gemfile.lock to leverage Docker's layer caching
COPY Gemfile Gemfile.lock ./

# Install the Ruby gems
RUN bundle install

# Copy the rest of the application source code
COPY . .

# Build the Jekyll site. The output will be in the /usr/src/app/_site directory.
RUN bundle exec jekyll build

# ---

# Stage 2: The Production Environment
# We use a lightweight Nginx image to serve the static files.
FROM nginx:alpine

# Copy the built static site from the 'builder' stage
COPY --from=builder /usr/src/app/_site /usr/share/nginx/html

# Expose port 80 to allow traffic to the web server
EXPOSE 80
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
source 'https://rubygems.org'
gem 'github-pages'

gem 'github-pages', '~> 232'

ruby '3.2.2'
6 changes: 2 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ GEM
remote: https://rubygems.org/
specs:
RedCloth (4.2.9)
activesupport (4.2.6)
activesupport (4.2.11.3)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
Expand Down Expand Up @@ -89,7 +88,6 @@ GEM
gemoji (~> 2.0)
html-pipeline (~> 2.2)
jekyll (>= 2.0)
json (1.8.3)
kramdown (1.10.0)
liquid (3.0.6)
listen (3.0.6)
Expand Down Expand Up @@ -132,4 +130,4 @@ DEPENDENCIES
github-pages

BUNDLED WITH
1.11.2
2.7.2