Reduce size of container image (#1777)

* Reduce size of container image
* Add deprecation message for automatic --mathjax
This commit is contained in:
Ryan Govostes
2021-12-22 14:54:29 -05:00
committed by GitHub
parent 93d3d10453
commit 7e379cfab1
3 changed files with 20 additions and 8 deletions
+2 -2
View File
@@ -34,5 +34,5 @@ jobs:
run: echo ${{ steps.docker_build.outputs.digest }}
- name: docker state
run: docker image ls
- name: Run tests
run: docker run -e CI=true -w /app --entrypoint bundle ${{ env.CI_IMAGE }} exec rake
- name: Run gollum as test
run: docker run -e CI=true ${{ env.CI_IMAGE }} --irb
+16 -5
View File
@@ -1,9 +1,11 @@
FROM ruby:2.7
ENV DEBIAN_FRONTEND="noninteractive"
FROM ruby:2.7-alpine AS builder
RUN apt-get update && apt-get install -y \
libicu-dev \
cmake
RUN apk add \
build-base \
cmake \
git \
icu-dev \
openssl-dev
COPY Gemfile* /tmp/
COPY gollum.gemspec* /tmp/
@@ -23,6 +25,15 @@ WORKDIR /app
COPY . /app
RUN bundle exec rake install
FROM ruby:2.7-alpine
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
RUN apk add \
bash \
git
VOLUME /wiki
WORKDIR /wiki
COPY docker-run.sh /docker-run.sh
+2 -1
View File
@@ -6,4 +6,5 @@ if [ ! -d .git ]; then
fi
# Start gollum service
gollum --mathjax
[[ "$@" != *--mathjax* ]] && echo "WARNING: Mathjax will soon be disabled by default. To explicitly enable it, use --mathjax" >&2
exec gollum $@ --mathjax