kubernaut/Dockerfile
Ryan Cavicchioni 89367e3169
All checks were successful
Gitea Actions Demo / lint (push) Successful in 21s
Gitea Actions Demo / test (push) Successful in 12s
Gitea Actions Demo / docker (push) Successful in 2m7s
switch to Debian bookworn Ruby image
2025-04-20 12:23:00 -05:00

41 lines
660 B
Docker

ARG RUBY_VERSION="3.4.3"
FROM ruby:${RUBY_VERSION} AS base
WORKDIR /app
RUN <<EOT
apt-get update
gem update --system --no-document
gem install -N bundler
EOT
FROM base AS build
RUN <<EOT
apt-get install --yes gcc make
EOT
COPY Gemfile* .
RUN <<EOT
bundle config set --local without development
bundle install
EOT
FROM base
# 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 4567
CMD [ "bundle", "exec", "rackup", "--host", "0.0.0.0", "--port", "4567" ]