Files
kubernaut/dockerfiles/bookworm.Dockerfile
Ryan Cavicchioni 3398dc786b
All checks were successful
Gitea Actions Demo / lint (push) Successful in 21s
Gitea Actions Demo / test (push) Successful in 14s
Gitea Actions Demo / docker (push) Successful in 2m29s
don't install apt-get recommendations
2025-04-29 13:52:08 -05:00

45 lines
682 B
Docker

ARG RUBY_VERSION="3.4.3"
FROM ruby:${RUBY_VERSION}-slim-bookworm AS base
WORKDIR /app
RUN <<EOT
apt-get update
gem update --system --no-document
gem install -N bundler
EOT
FROM base AS build
ENV BUNDLE_DEPLOYMENT=true \
BUNDLE_WITHOUT="development test"
RUN <<EOT
apt-get install --yes --no-install-recommends gcc make libc-dev
EOT
COPY Gemfile* .
RUN <<EOT
bundle install
EOT
FROM base
ENV PORT=4567
# RUN useradd ruby --home /app --shell /bin/sh
RUN useradd --home /app --create-home app
USER app:app
COPY --from=build /usr/local/bundle /usr/local/bundle
COPY --from=build --chown=app:app /app /app
COPY --chown=app:app . .
EXPOSE $PORT
CMD [ "puma" ]