# Auto-generated by GitBlixt for Rails apps FROM docker.io/ruby:3.3-slim AS base RUN apt-get update -qq \ && apt-get install -y --no-install-recommends \ build-essential git libpq-dev curl ca-certificates nodejs npm \ && rm -rf /var/lib/apt/lists/* WORKDIR /app ENV RAILS_ENV=production ENV BUNDLE_DEPLOYMENT=true ENV BUNDLE_WITHOUT=development:test COPY Gemfile Gemfile.lock* ./ RUN bundle install --jobs 4 COPY . . # If database.yml is missing (e.g. gitignored), generate one that reads DATABASE_URL RUN if [ ! -f config/database.yml ]; then \ printf 'production:\n url: <%%= ENV["DATABASE_URL"] %%>\n' > config/database.yml; \ fi RUN if [ -f bin/rails ]; then \ bundle exec rails assets:precompile 2>/dev/null || true; \ fi ENV PORT=4000 EXPOSE ${PORT} CMD bundle exec puma -b tcp://0.0.0.0:${PORT}