kubernaut/dockerfiles/alpine.Dockerfile
Ryan Cavicchioni 67e7997555
All checks were successful
Gitea Actions Demo / lint (push) Successful in 21s
Gitea Actions Demo / test (push) Successful in 13s
Gitea Actions Demo / docker (push) Successful in 2m41s
docker/bake-action v6.6.0
Use bake-action instead of build-and-push action.
2025-04-27 21:13:34 -05:00

42 lines
613 B
Docker

ARG RUBY_VERSION="3.4.3"
FROM ruby:${RUBY_VERSION}-alpine AS base
WORKDIR /app
RUN <<EOT
apk update
gem update --system --no-document
gem install -N bundler
EOT
FROM base AS build
RUN <<EOT
apk add musl-dev gcc make
EOT
COPY Gemfile* .
RUN <<EOT
bundle config set --local without development
bundle install
EOT
FROM base
ENV PORT=4567
RUN adduser --home /app --disabled-password 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" ]