Skip to content

Commit 59b64b6

Browse files
committed
Add a Dockerfile and script to run a development jekyll server
Co-authored-by: Keith Wall<[email protected]> Signed-off-by: Robert Young <[email protected]>
1 parent 02ae5b2 commit 59b64b6

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.jekyll-cache
2+
.gitignore
3+
run.sh
4+
Dockerfile
5+
.dockerignore
6+
.git
7+
.github

Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM ubuntu:24.04
2+
3+
ENV JEKYLL_SERVE_BIND=127.0.0.1
4+
5+
RUN apt-get update && \
6+
apt install -y git \
7+
curl \
8+
build-essential \
9+
libssl-dev \
10+
libreadline-dev \
11+
zlib1g-dev \
12+
libffi-dev \
13+
libyaml-dev \
14+
libncurses5-dev \
15+
libgdbm-dev \
16+
unzip \
17+
wget \
18+
golang && \
19+
rm -rf /var/lib/apt/lists/*
20+
ENV RBENV_ROOT /usr/local/rbenv
21+
RUN git clone https://github.com/rbenv/rbenv.git ${RBENV_ROOT} && \
22+
git clone https://github.com/rbenv/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build
23+
24+
ENV PATH="${RBENV_ROOT}/bin:/root/go/bin:${PATH}"
25+
RUN eval "$(rbenv init -)" && \
26+
rbenv install 3.4.4 && \
27+
rbenv global 3.4.4 && \
28+
gem install bundler && \
29+
go install github.com/asciitosvg/asciitosvg/cmd/a2s@latest
30+
31+
COPY Gemfile .
32+
COPY Gemfile.lock .
33+
RUN eval "$(rbenv init -)" && \
34+
bundle install
35+
36+
RUN mkdir /css/
37+
WORKDIR /css/
38+
COPY _sass .
39+
COPY bootstrap_setup.sh .
40+
RUN ./bootstrap_setup.sh
41+
42+
RUN mkdir /site/
43+
WORKDIR /site/
44+
COPY . .
45+
RUN cp -r /css/_sass/* /site/_sass
46+
47+
EXPOSE 4000
48+
49+
CMD eval "$(rbenv init -)" && bundle exec jekyll serve --host ${JEKYLL_SERVE_BIND}

run.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
OS=$(uname)
3+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
4+
cd ${SCRIPT_DIR}
5+
CONTAINER_ENGINE=${CONTAINER_ENGINE:-podman}
6+
7+
RUN_ARGS=()
8+
if [ "$OS" = 'Darwin' ]; then
9+
RUN_ARGS+=(--env JEKYLL_SERVE_BIND=0.0.0.0 --publish 4000:4000)
10+
else
11+
RUN_ARGS+=(--net host)
12+
fi
13+
RUN_ARGS+=(--rm -it kroxylicious-website)
14+
15+
${CONTAINER_ENGINE} build . -t kroxylicious-website
16+
17+
${CONTAINER_ENGINE} run "${RUN_ARGS[@]}"

0 commit comments

Comments
 (0)