FROM ruby:4.0.6 # Install system dependencies including Node.js RUN apt-get update -qq && \ apt-get install --no-install-recommends -y \ build-essential \ fontconfig \ git \ libpq-dev \ libyaml-dev \ postgresql-client \ libvips \ pkg-config \ curl \ tar \ nodejs \ npm \ woff2 \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives # Install Bun RUN curl -fsSL https://bun.sh/install | bash && \ mv ~/.bun/bin/bun /usr/local/bin/ # Set working directory WORKDIR /app # Install npm dependencies for Vite. COPY package.json bun.lock bunfig.toml ./ COPY patches patches RUN bun install && \ bun x playwright install --with-deps --only-shell chromium && \ rm -rf /var/lib/apt/lists/* /var/cache/apt/archives # Make Spline Sans available to librsvg/libvips via fontconfig. Pango does not # rasterize the bundled WOFF2 reliably, so dev installs a converted TTF. RUN cp /app/node_modules/@fontsource-variable/spline-sans/files/spline-sans-latin-wght-normal.woff2 /tmp/spline-sans-latin-wght-normal.woff2 && \ woff2_decompress /tmp/spline-sans-latin-wght-normal.woff2 && \ install -Dm644 /tmp/spline-sans-latin-wght-normal.ttf \ /usr/local/share/fonts/spline-sans/spline-sans-latin-wght-normal.ttf && \ fc-cache -f /usr/local/share/fonts/spline-sans # Install application dependencies COPY Gemfile Gemfile.lock ./ RUN bundle install # Rebuild native extensions for default gems that ship without compiled # extensions in the base image. Without this, Bundler floods every command # with "Source locally installed gems is ignoring..." warnings. RUN gem pristine --extensions json erb bigdecimal rdoc # The base image can ship rdoc in the default gem path with a rubygems plugin # that auto-loads on every gem/bundler invocation. The Gemfile also resolves # rdoc, so both copies can be required and emit "already initialized constant" # warnings. Removing the default-path copy leaves only the bundled rdoc. RUN gem uninstall -i "$(ruby -e 'print Gem.default_dir')" -I -x rdoc --all || true # Add a script to be executed every time the container starts COPY entrypoint.dev.sh /usr/bin/ RUN chmod +x /usr/bin/entrypoint.dev.sh ENTRYPOINT ["entrypoint.dev.sh"] # Global git safeguards RUN git config --system http.timeout 30 && \ git config --system http.lowSpeedLimit 1000 && \ git config --system http.lowSpeedTime 10 EXPOSE 3000 EXPOSE 33149 # Disable dev warnings RUN bundle exec skylight disable_dev_warning RUN bundle config set default_cli_command install --global # Start the main process CMD ["rails", "server", "-b", "0.0.0.0"]