kubernaut/dockerfiles/bookworm.Dockerfile
Ryan Cavicchioni ff044ada8b
Some checks failed
Gitea Actions Demo / lint (push) Successful in 24s
Gitea Actions Demo / test (push) Successful in 12s
Gitea Actions Demo / docker (push) Failing after 1m51s
don't install apt-get recommendations
2025-04-28 16:43:37 -05:00

45 lines
673 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
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" ]