Reduce size of container image (#1777)
* Reduce size of container image * Add deprecation message for automatic --mathjax
This commit is contained in:
@@ -34,5 +34,5 @@ jobs:
|
|||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
- name: docker state
|
- name: docker state
|
||||||
run: docker image ls
|
run: docker image ls
|
||||||
- name: Run tests
|
- name: Run gollum as test
|
||||||
run: docker run -e CI=true -w /app --entrypoint bundle ${{ env.CI_IMAGE }} exec rake
|
run: docker run -e CI=true ${{ env.CI_IMAGE }} --irb
|
||||||
|
|||||||
+16
-5
@@ -1,9 +1,11 @@
|
|||||||
FROM ruby:2.7
|
FROM ruby:2.7-alpine AS builder
|
||||||
ENV DEBIAN_FRONTEND="noninteractive"
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apk add \
|
||||||
libicu-dev \
|
build-base \
|
||||||
cmake
|
cmake \
|
||||||
|
git \
|
||||||
|
icu-dev \
|
||||||
|
openssl-dev
|
||||||
|
|
||||||
COPY Gemfile* /tmp/
|
COPY Gemfile* /tmp/
|
||||||
COPY gollum.gemspec* /tmp/
|
COPY gollum.gemspec* /tmp/
|
||||||
@@ -23,6 +25,15 @@ WORKDIR /app
|
|||||||
COPY . /app
|
COPY . /app
|
||||||
RUN bundle exec rake install
|
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
|
VOLUME /wiki
|
||||||
WORKDIR /wiki
|
WORKDIR /wiki
|
||||||
COPY docker-run.sh /docker-run.sh
|
COPY docker-run.sh /docker-run.sh
|
||||||
|
|||||||
+2
-1
@@ -6,4 +6,5 @@ if [ ! -d .git ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Start gollum service
|
# 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
|
||||||
|
|||||||
Reference in New Issue
Block a user