Skip to content

Instantly share code, notes, and snippets.

@andrewsheelan
Created March 14, 2023 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewsheelan/65e4767e60dd7e353aa61d7157472c76 to your computer and use it in GitHub Desktop.
Save andrewsheelan/65e4767e60dd7e353aa61d7157472c76 to your computer and use it in GitHub Desktop.
Truffle Ruby - Rails Dockerfile
# truffleruby 22.3.1, like ruby 3.0.3, GraalVM CE Native
FROM ghcr.io/graalvm/truffleruby:22.3.1
WORKDIR /app
# Install updates and tools required for builds
RUN yum update -y && yum install -y gcc-c++ patch readline readline-devel zlib \
zlib-devel libyaml libxml2 xz libffi-devel openssl-devel make bzip2 \
autoconf automake libtool nodejs tzdata libffi libicu-devel git \
postgresql-devel bash wget && yum clean all
# Install Yarn
RUN npm install -g yarn
COPY . .
RUN gem install bundler
# If this times out a lot, build and then bundle before run
# CMD ["bash", "-c", "bundle install && rails server -b 0.0.0.0"]
# Not the best solution
RUN bundle install --verbose
# Newer Ruby syntax with one line functions will not work with this Dockerfile
EXPOSE 3000
# Expose the following two ports below for debugging with ruby debug IDE.
EXPOSE 1234
EXPOSE 26162
CMD ["rails", "server", "-b", "0.0.0.0"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment