-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
39 lines (27 loc) · 876 Bytes
/
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
FROM docker.io/library/ruby:3.1.4-slim as build
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
make \
gcc \
libgit2-dev \
cmake \
pkg-config && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Ensure rugged is built with SSH support
ENV CMAKE_FLAGS='-DUSE_SSH=ON'
COPY .bundle Gemfile Gemfile.lock ./
RUN bundle install --deployment --jobs=4 --without development test \
&& bundle clean
COPY . .
FROM docker.io/library/ruby:3.1.4-slim as run
WORKDIR /app
COPY --from=build /app /app
RUN bundle config --local path vendor/bundle
RUN bundle config --local without development:test
ARG UID=30000
ARG GID=$UID
RUN groupadd -g "${GID}" -r oxidized && useradd -u "${UID}" -r -m -d /home/oxidized -g oxidized oxidized
USER oxidized
ENTRYPOINT ["bundle", "exec", "oxidized"]
CMD ["--version"]