Giter VIP home page Giter VIP logo

docker-rails-rbenv's Introduction

Rails on Docker

Build a docker image ready to develop rails apps. Rbenv is used to manage ruby.

To change the default ruby version installed (2.1.2), edit the Dockerfile

The image is ready to launch a rails app (tested with 4.1.1). The supervisor daemon launches a SSH server.

Build the image with: docker build -t <MY_NAME>/rails-rbenv . Launch a container with: docker run -d -i -t -P <MY_NAME>/rails-rbenv

User docker ps to check which ports are used to map 22 and 3000 ports of the container. To access the container the user is railsuser and the password s3cr3t (the user is also a sudoer)

You can ssh into the container and work by terminal or, as I suggest, mount a volume of the host where you have the rails project files, and launch the rails app from the container, so you can use an editor in the host to work on the project:

cd /PATH/TO/RAILS/PROJECT
docker run -P -d -i -t -v `pwd`:/home/railsuser/app tommyblue/rails-rbenv

SSH into the container then install required gems:

ssh [email protected] -p <CONTAINER_SSH_PORT>
cd ~/app
bundle install
bundle exec rails server

docker-rails-rbenv's People

Contributors

tommyblue avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.