Something went wrong. Try again.
Managing loaner chromebooks for students and teachers in the HUUSD school district.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263# syntax = docker/dockerfile:1
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and GemfileARG RUBY_VERSION=3.1.5FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
# Rails app lives hereWORKDIR /rails
# Set production environmentENV RAILS_ENV="production" \ BUNDLE_DEPLOYMENT="1" \ BUNDLE_PATH="/usr/local/bundle" \ BUNDLE_WITHOUT="development"
# Throw-away build stage to reduce size of final imageFROM base as build
# Install packages needed to build gemsRUN apt-get update -qq && \ apt-get install --no-install-recommends -y build-essential git libvips pkg-config
# Install application gemsCOPY Gemfile Gemfile.lock ./RUN bundle install && \ rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \ bundle exec bootsnap precompile --gemfile
# Copy application codeCOPY . .
# Precompile bootsnap code for faster boot timesRUN bundle exec bootsnap precompile app/ lib/
# Precompiling assets for production without requiring secret RAILS_MASTER_KEYRUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
# Final stage for app imageFROM base
# Install packages needed for deploymentRUN apt-get update -qq && \ apt-get install --no-install-recommends -y curl libsqlite3-0 libvips && \ rm -rf /var/lib/apt/lists /var/cache/apt/archives
# Copy built artifacts: gems, applicationCOPY --from=build /usr/local/bundle /usr/local/bundleCOPY --from=build /rails /rails
# Run and own only the runtime files as a non-root user for securityRUN useradd rails --create-home --shell /bin/bash && \ chown -R rails:rails db log storage tmpUSER rails:rails
# Entrypoint prepares the database.ENTRYPOINT ["/rails/bin/docker-entrypoint"]
# Start the server by default, this can be overwritten at runtimeEXPOSE 3000CMD ["./bin/rails", "server"]