Skip to content

Instantly share code, notes, and snippets.

@SLIB53
Created July 25, 2021 21:38
Show Gist options
  • Save SLIB53/3f63ae55381fcb476174bd6ea5b5ae90 to your computer and use it in GitHub Desktop.
Save SLIB53/3f63ae55381fcb476174bd6ea5b5ae90 to your computer and use it in GitHub Desktop.
Rails Development in a Fedora Container

To install Ruby on Rails, you will need some system dependencies, and then install the Rails gem:

dnf group install "C Development Tools and Libraries"
dnf install zlib-devel ruby-devel
gem install rails

To create a Rails blog, you will need some dependencies, and then use Rails to create a new blog:

dnf install sqlite-devel nodejs
npm install --global yarn
rails new blog

To run the server from a development container, the container should publish port 3000, and the Rails server should bind to 0.0.0.0:

docker run -d \
    --name my-rails-app-1 \
    --publish 3000:3000 \
    devbox sleep infinity

...

docker exec -it \
    --workdir /home/app/blog \
    devbox bin/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