feat(docs): Improve jekyll dependencies to speed up docker image build

This commit is contained in:
FoxxMD
2022-11-15 13:38:36 -05:00
parent 718f81b921
commit 5183747219
3 changed files with 31 additions and 27 deletions

View File

@@ -96,11 +96,26 @@ WORKDIR /app
FROM base as build
# copy NPM dependencies and install
COPY --chown=abc:abc package*.json ./
COPY --chown=abc:abc tsconfig.json .
RUN npm install
# copy bundle/jekyll dependencies and docs folder
COPY --chown=abc:abc Gemfile Gemfile.lock _config.yml ./
COPY --chown=abc:abc docs ./docs/
# sassc (a jekll dependency) is very slow to compile bc there are no alpine binaries
# https://github.com/sass/sassc-ruby/issues/189#issuecomment-629758948
# so for now sync used jekyll version with prebuilt binary available in alpine repo
RUN apk add --no-cache --virtual .build-deps \
ruby-jekyll \
&& bundle install \
&& jekyll build -b /docs \
&& apk del .build-deps \
&& rm -rf docs
COPY --chown=abc:abc . /app
RUN npm run build && rm -rf node_modules
@@ -115,16 +130,6 @@ RUN npm install --production \
&& rm -rf node_modules/ts-node \
&& rm -rf node_modules/typescript
# https://github.com/sass/sassc-ruby/issues/189#issuecomment-629758948
# sassc is very slow to compile bc there are no alpine binaries
RUN apk add --no-cache --virtual .build-deps \
make gcc g++ ruby-bundler ruby-dev \
&& gem install bundler:2.3.9 \
&& bundle install \
&& bundle exec jekyll build -b /docs \
&& apk del .build-deps \
&& rm -rf docs
ENV NPM_CONFIG_LOGLEVEL debug
# can set database to use more performant better-sqlite3 since we control everything

View File

@@ -1,6 +1,9 @@
source 'https://rubygems.org'
gem "jekyll", "~> 4.3" # installed by `gem jekyll`
# sassc (a jekll dependency) is very slow to compile bc there are no alpine binaries
# https://github.com/sass/sassc-ruby/issues/189#issuecomment-629758948
# so for now sync used jekyll version with prebuilt binary available in alpine repo
gem "jekyll", "4.2.2" # installed by `gem jekyll`
# gem "webrick" # required when using Ruby >= 3 and Jekyll <= 4.2.2
gem "just-the-docs", "0.4.0.rc3" # currently the latest pre-release

View File

@@ -14,22 +14,21 @@ GEM
http_parser.rb (0.8.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jekyll (4.3.0)
jekyll (4.2.2)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3, >= 2.3.1)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (>= 0.3.6, < 0.5)
mercenary (~> 0.4.0)
pathutil (~> 0.9)
rouge (>= 3.0, < 5.0)
rouge (~> 3.0)
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
terminal-table (~> 2.0)
jekyll-default-layout (0.1.5)
jekyll (>= 3.0, < 5.0)
jekyll-optional-front-matter (0.3.2)
@@ -67,22 +66,19 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (4.0.0)
rouge (3.30.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.3.0)
webrick (1.7.0)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.8.0)
PLATFORMS
arm64-darwin-21
x86_64-darwin-19
x86_64-linux
DEPENDENCIES
jekyll (~> 4.3)
jekyll (= 4.2.2)
jekyll-default-layout
jekyll-optional-front-matter
jekyll-readme-index
@@ -91,4 +87,4 @@ DEPENDENCIES
just-the-docs (= 0.4.0.rc3)
BUNDLED WITH
2.3.9
2.3.25