Skip to content
Merged
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
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git
.github
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
node_modules
*.swp
*.swo
*~
.DS_Store
15 changes: 15 additions & 0 deletions .github/workflows/docker-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Verify Docker Build

on:
pull_request:
branches: ["master"]

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build Docker image
run: docker build -t jekyll-site:pr-${{ github.event.pull_request.number }} .
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM ruby:3.3-slim

# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*

# Configure bundler to install gems system-wide
ENV BUNDLE_PATH=/usr/local/bundle
ENV BUNDLE_BIN=/usr/local/bundle/bin
ENV GEM_HOME=/usr/local/bundle
ENV PATH="${BUNDLE_BIN}:${PATH}"

# Set working directory
WORKDIR /site

# Copy Gemfile and install dependencies
COPY Gemfile Gemfile.lock ./
RUN bundle install

# Copy the rest of the site
COPY . .

# Expose Jekyll's default port
EXPOSE 4000

# Run Jekyll server with live reload and incremental builds
CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0", "--livereload", "--incremental", "--drafts"]
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ This is my website. 😊

`bundle update --bundler` to update the bundler version.

`bundle exec jekyll serve` to build + start server.
`bundle exec jekyll serve` to build + start server.

### Docker

`docker build -t jekyll-site .`

`docker run --rm -p 4000:4000 -v .:/site:Z jekyll-site`
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
jekyll:
build: .
ports:
- "4000:4000" # Jekyll server
- "35729:35729" # LiveReload
volumes:
- .:/site:Z
environment:
- JEKYLL_ENV=development