-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
48 lines (35 loc) · 1.32 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
ARG GEM_FOLDER="/usr/local/bundle"
ARG BASE_IMAGE=ruby:alpine3.20
FROM $BASE_IMAGE as doc-generator
ARG GEM_FOLDER
ENV GEM_HOME=$GEM_FOLDER
ENV PATH $GEM_HOME/bin:$GEM_HOME/gems/bin:$PATH
WORKDIR /doc_generator
RUN apk add --no-cache ruby ruby-etc ruby-dev ruby-irb ruby-rake ruby-io-console \
ruby-bigdecimal make gcc ruby-json libstdc++ tzdata bash \
libc-dev libpq-dev openjdk17-jre
COPY Gemfile .
COPY Gemfile.lock .
COPY doc_generation /doc_generator/doc_generation
COPY scripts /doc_generator/scripts
COPY docs docs
RUN echo 'gem: --no-document' > /etc/gemrc \
&& bundle install \
&& gem cleanup \
&& rm -rf /tmp/* /var/cache/apk/*
RUN bundle config set --local path 'vendor/bundle' && bundle install && gem cleanup && ./scripts/doc_generate.sh .
FROM $BASE_IMAGE
ARG GEM_FOLDER
ENV GEM_HOME=$GEM_FOLDER
ENV PATH $GEM_HOME/bin:$GEM_HOME/gems/bin:$PATH
RUN apk add --no-cache ruby ruby-etc ruby-dev ruby-irb ruby-rake ruby-io-console ruby-bigdecimal ruby-json \
openjdk17-jre \
bash
COPY --from=doc-generator /usr/local/bundle /usr/local/bundle
COPY --from=doc-generator /doc_generator/docs /docs
RUN adduser --uid 2004 --disabled-password --gecos "" docker
COPY target/universal/stage/ /workdir/
RUN chmod +x /workdir/bin/codacy-rubocop
USER docker
WORKDIR /workdir
ENTRYPOINT ["bin/codacy-rubocop"]