toy/Dockerfile
Ryan Cavicchioni 799f88cc53
All checks were successful
Gitea Actions Demo / release-image (push) Successful in 59s
remove dev Docker image
2024-07-02 16:19:32 -05:00

40 lines
642 B
Docker

FROM ruby:alpine AS base
WORKDIR /app
RUN <<EOT
gem update --system --no-document
gem install -N bundler
apk update
apk upgrade --no-cache
EOT
FROM base AS build
RUN <<EOT
apk add gcc musl-dev ruby-dev 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 adduser ruby -h /app -D
USER ruby:ruby
COPY --from=build /usr/local/bundle /usr/local/bundle
COPY --from=build --chown=ruby:ruby /app /app
COPY --chown=ruby:ruby . .
EXPOSE 4567
CMD [ "bundle", "exec", "rackup", "--host", "0.0.0.0", "--port", "4567" ]