Skip to content

Commit 69e794b

Browse files
authored
Merge pull request #96 from willcl-ark/modernise-docker
2 parents 6330955 + 644247c commit 69e794b

File tree

11 files changed

+412
-171
lines changed

11 files changed

+412
-171
lines changed

.dockerignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Build output
2+
_site/
3+
bin/
4+
*.html
5+
*.pdf
6+
*.epub
7+
8+
# Dependencies
9+
node_modules/
10+
.gem/
11+
vendor/
12+
13+
# Git
14+
.git/
15+
.gitignore
16+
17+
# Editor/IDE
18+
.vscode/
19+
.idea/
20+
*.swp
21+
*.swo
22+
*~
23+
24+
# OS
25+
.DS_Store
26+
Thumbs.db
27+
28+
# Temporary files
29+
*.tmp
30+
*.temp
31+
/tmp
32+
33+
# Logs
34+
*.log
35+
npm-debug.log*
36+
37+
# Docker
38+
Dockerfile*
39+
docker-compose*
40+
.dockerignore
41+
42+
# Development
43+
TODO
44+
ATMP-validation-flow.png
45+
OP_RETURN.ipynb
46+
exercise_tutorial-extended_class.ipynb
47+
favicon.ico
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: 'Setup Build Environment'
2+
description: 'Set up Ruby, Node.js, and dependencies for Jekyll site building'
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: Install Ruby and Jekyll
8+
uses: ruby/setup-ruby@v1
9+
with:
10+
ruby-version: '3.3.8'
11+
bundler-cache: true
12+
cache-version: 1
13+
- name: Setup Node.JS 22
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 22
17+
- name: Install mermaid-cli
18+
shell: bash
19+
run: npm install -g @mermaid-js/mermaid-cli
20+
- name: Install bundle dependencies
21+
shell: bash
22+
run: bundle

.github/workflows/build.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,10 @@ jobs:
1717
- name: Configure Pages
1818
id: pages
1919
uses: actions/configure-pages@v5
20-
- name: Install Ruby and Jekyll
21-
uses: ruby/setup-ruby@v1
22-
with:
23-
ruby-version: '3.2.2'
24-
bundler-cache: true
25-
cache-version: 0
26-
- name: Setup Node.JS 18
27-
uses: actions/setup-node@v4
28-
with:
29-
node-version: 18
30-
- name: Install mermaid-cli
31-
run: npm install -g @mermaid-js/mermaid-cli
20+
- name: Setup Build Environment
21+
uses: ./.github/actions/setup-build
3222
- name: Generate Site
33-
run: |
34-
bundle
35-
make all
23+
run: make all
3624
env:
3725
JEKYLL_ENV: production
3826
ADD_JEKYLL_ARGS: --baseurl "${{ steps.pages.outputs.base_path }}"

.github/workflows/publish.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,10 @@ jobs:
2525
- name: Configure Pages
2626
id: pages
2727
uses: actions/configure-pages@v5
28-
- name: Install Ruby and Jekyll
29-
uses: ruby/setup-ruby@v1
30-
with:
31-
ruby-version: '3.2.2'
32-
bundler-cache: true
33-
cache-version: 0
34-
- name: Setup Node.JS 18
35-
uses: actions/setup-node@v4
36-
with:
37-
node-version: 18
38-
- name: Install mermaid-cli
39-
run: npm install -g @mermaid-js/mermaid-cli
28+
- name: Setup Build Environment
29+
uses: ./.github/actions/setup-build
4030
- name: Generate Site
41-
run: |
42-
bundle
43-
make publish
31+
run: make publish
4432
env:
4533
JEKYLL_ENV: production
4634
ADD_JEKYLL_ARGS: --baseurl "${{ steps.pages.outputs.base_path }}"
File renamed without changes.

Dockerfile

Lines changed: 34 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,34 @@
1-
FROM ruby:3.2.2-slim-bookworm
2-
3-
RUN apt update && \
4-
apt --yes upgrade && \
5-
apt --yes install build-essential curl procps git \
6-
fonts-liberation libasound2 \
7-
libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 \
8-
libfontconfig1 libgbm1 libgcc1 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 \
9-
libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 \
10-
libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
11-
--no-install-recommends && \
12-
rm -rf /var/lib/apt/lists/*
13-
14-
ARG UID=1000
15-
ARG GID=1000
16-
17-
WORKDIR /srv/
18-
COPY Gemfile /srv/Gemfile
19-
20-
RUN groupadd -g ${GID} docs && \
21-
useradd -m -u ${UID} -g docs -s /bin/bash docs
22-
RUN chown -R docs:docs /srv/
23-
USER docs
24-
25-
RUN bash -l -c "echo 'export GEM_HOME=${HOME}/.gem' >> ${HOME}/.bashrc \
26-
&& echo 'export GEM_PATH=${HOME}/.gem' >> ${HOME}/.bashrc \
27-
&& source ~/.bashrc \
28-
&& bundle config set --local path ${HOME}/.gem \
29-
&& bundle install"
30-
31-
RUN bash -l -c "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash \
32-
&& export NVM_DIR=\"\$([ -z \"${XDG_CONFIG_HOME-}\" ] && printf %s \"${HOME}/.nvm\" || printf %s \"${XDG_CONFIG_HOME}/nvm\")\" \
33-
&& [ -s \"\$NVM_DIR/nvm.sh\" ] && \\. \"\$NVM_DIR/nvm.sh\" \
34-
&& echo 'export PATH=${PATH}:/srv/node_modules/.bin' >> ${HOME}/.bashrc \
35-
&& source ~/.bashrc \
36-
&& nvm install node \
37-
&& npm install @mermaid-js/mermaid-cli"
38-
39-
ENV LANG C.UTF-8
40-
ENV LC_ALL C.UTF-8
41-
ENTRYPOINT ["bash", "-l"]
1+
FROM docker.io/library/ruby:3.3.8-alpine
2+
3+
# Install system dependencies
4+
RUN apk add --no-cache \
5+
build-base \
6+
git \
7+
nodejs \
8+
npm \
9+
chromium \
10+
make
11+
12+
# Set chromium path for puppeteer (needed for mermaid diagrams)
13+
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
14+
15+
# Install latest bundler version
16+
RUN gem install bundler
17+
18+
# Install mermaid-cli globally
19+
RUN npm install -g @mermaid-js/mermaid-cli
20+
21+
WORKDIR /srv
22+
23+
# Copy dependency files first for better caching
24+
COPY Gemfile Gemfile.lock package*.json ./
25+
26+
# Install dependencies
27+
RUN bundle install && npm install
28+
29+
# Ensure bundle bin is in PATH
30+
ENV PATH="/usr/local/bundle/bin:$PATH"
31+
32+
EXPOSE 4000
33+
34+
CMD ["sh", "-c", "bundle install && bundle exec jekyll serve --host 0.0.0.0 --future --drafts --unpublished --incremental --force_polling"]

Gemfile

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
11
source 'https://rubygems.org'
22

3-
## If you update the version here, also update it in .travis.yml, .ruby-version,
4-
## and README.md. Then push your branch and make sure Travis supports that
5-
## version.
6-
ruby '3.2.2'
3+
## If you update the version here, also update it in Docker and GitHub Actions
4+
ruby '3.3.8'
75

8-
gem "asciidoctor", "~>2.0.20"
9-
gem "rouge"
6+
gem "asciidoctor", "~>2.0.23"
7+
gem "rouge", "~> 4.4"
8+
gem "csv", "~> 3.3"
9+
gem "base64", "~> 0.2"
1010

1111
## If you add a new Gem below, run `bundle install` to install it.
1212
group :development do
13-
gem "jekyll", "~> 4.3.2"
14-
gem "just-the-docs"
15-
gem 'jekyll-redirect-from'
13+
gem "jekyll", "~> 4.3.4"
14+
gem "just-the-docs", "~> 0.10"
15+
gem 'jekyll-redirect-from', '~> 0.16'
1616
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
1717
# do not have a Java counterpart.
1818
#gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
1919
end
2020

2121
group :jekyll_plugins do
22-
gem "asciidoctor-diagram"
23-
gem "jekyll-feed", "~> 0.12"
24-
gem "jekyll-asciidoc", "~> 3.0.0"
22+
gem "asciidoctor-diagram", "~> 2.3"
23+
gem "jekyll-feed", "~> 0.17"
24+
gem "jekyll-asciidoc", "~> 3.0.1"
2525
end
2626

2727
group :asciidoc_plugins do
28-
gem "asciidoctor-epub3"
29-
gem "asciidoctor-pdf"
28+
gem "asciidoctor-epub3", "~> 2.1"
29+
gem "asciidoctor-pdf", "~> 2.3"
30+
gem "rubyzip", "~> 2.3.0"
3031
end
3132

3233
group :testing do
33-
gem 'html-proofer'
34-
gem 'mdl'
35-
gem 'json-schema'
36-
gem 'toml'
34+
gem 'html-proofer', '~> 5.0'
35+
gem 'mdl', '~> 0.13'
36+
gem 'json-schema', '~> 5.0'
37+
gem 'toml', '~> 0.3'
3738
end

0 commit comments

Comments
 (0)