kubernaut/Dockerfile
Ryan Cavicchioni 69c6b30255
All checks were successful
Gitea Actions Demo / lint (push) Successful in 22s
Gitea Actions Demo / test (push) Successful in 11s
Gitea Actions Demo / docker (push) Successful in 2m3s
use puma directly in Dockerfile
2025-04-20 12:45:26 -05:00

43 lines
656 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
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 4567
CMD [ "puma", "--bind", "0.0.0.0", "--port", "$PORT" ]