Ryan Cavicchioni
a8f3a655f9
All checks were successful
Gitea Actions Demo / release-image (push) Successful in 1m0s
56 lines
812 B
Docker
56 lines
812 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
|
|
|
|
RUN mkdir -p /run/app
|
|
|
|
|
|
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 build AS dev
|
|
|
|
WORKDIR /app
|
|
|
|
RUN <<EOT
|
|
bundle install
|
|
EOT
|
|
|
|
CMD [ "sleep", "infinity" ]
|
|
|
|
FROM base
|
|
|
|
# RUN useradd ruby --home /app --shell /bin/sh
|
|
RUN adduser ruby -h /app -D
|
|
|
|
RUN mkdir -p /run/app
|
|
|
|
RUN chown ruby:ruby /run/app
|
|
|
|
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" ]
|