Skip to content

Commit 6a6c22e

Browse files
committed
Switch to ruby base image
Fixes inconsistencies with the dependency management, fixes Docker build issues, and stops misusing Jekyll image.
1 parent f8e6aef commit 6a6c22e

1 file changed

Lines changed: 16 additions & 17 deletions

File tree

Dockerfile

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
FROM jekyll/jekyll:4.4.1 AS builder
1+
FROM ruby:3.2.11 AS builder
22

33
LABEL org.opencontainers.image.source="https://github.com/TeamNewPipe/website"
44

5-
COPY Gemfile /srv/jekyll
6-
RUN bundle install
5+
# make debugging easier
6+
SHELL ["/bin/bash", "-xc"]
77

8-
COPY Gemfile.lock /srv/jekyll
9-
RUN bash -xc "chown jekyll: Gemfile.lock && \
10-
cd /srv/jekyll && \
11-
gem install bundler && \
12-
bundle update"
8+
RUN mkdir /project/
9+
COPY Gemfile Gemfile.lock /project/
1310

14-
WORKDIR /srv/jekyll
11+
WORKDIR /project/
12+
13+
# run bundle lock to rewrite the Lockfile and therefore ignore version differences of bundler and the lockfile without updating dependencies
14+
RUN bundle lock && \
15+
bundle install
1516

1617
# define args and env vars before copying content to speed up subsequent builds, as they hardly ever change
1718
ARG ISSO_ADDRESS
@@ -23,14 +24,12 @@ ENV JEKYLL_ENV=production
2324
ENV TZ=Europe/Berlin
2425

2526
# copy data
26-
COPY . /srv/jekyll/
27-
28-
RUN bash -xc "chown -R jekyll: /srv/jekyll && \
29-
bundle update jekyll && \
30-
cd /srv/jekyll && \
31-
jekyll clean && \
32-
jekyll build && \
33-
mv _site/ /data"
27+
COPY . /project/
28+
29+
RUN bundle exec jekyll clean && \
30+
bundle exec jekyll build && \
31+
mv _site/ /data
32+
3433

3534
FROM nginx:alpine
3635

0 commit comments

Comments
 (0)