forked from gollum/gollum
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
57 lines (47 loc) · 1.17 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM ruby:3.1-alpine AS builder
RUN apk add --update \
--no-cache \
build-base \
cmake \
git \
icu-dev \
openssl-dev \
yaml-dev \
&& rm -rf /var/cache/apk/*
COPY Gemfile* /tmp/
COPY gollum.gemspec* /tmp/
WORKDIR /tmp
RUN bundle install
RUN gem install \
asciidoctor \
creole \
wikicloth \
org-ruby \
RedCloth \
bibtex-ruby \
&& echo "gem-extra complete"
WORKDIR /app
COPY . /app
RUN bundle exec rake install
FROM ruby:3.1-alpine
ARG UID=${UID:-1000}
ARG GID=${GID:-1000}
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
WORKDIR /wiki
RUN apk add --update \
--no-cache \
bash \
git \
libc6-compat \
openssh \
shadow \
&& rm -rf /var/cache/apk/* \
&& groupmod -g $GID www-data \
&& adduser -u $UID -S www-data -G www-data \
&& git config --file /home/www-data/.gitconfig --add safe.directory /wiki \
&& chown www-data:www-data /home/www-data/.gitconfig
COPY docker-run.sh /docker-run.sh
RUN chmod +x /docker-run.sh
USER www-data
VOLUME /wiki
ENTRYPOINT ["/docker-run.sh"]