drun
is a command-line tool designed to simplify the setup and management of a Ruby on Rails development environment using Docker. It allows you to quickly get started with Rails, especially if you are new to the framework.
With drun
, you can leverage Docker to handle all the dependencies required for your Rails application, providing a consistent environment across different machines. It eliminates the need for manual configuration and setup, making the development process more streamlined.
Before using drun
, make sure you have the following installed:
- Docker
- Docker Compose
To get started with drun
, follow these steps:
- Clone this repository:
git clone https://github.com/Rynaro/drun.git app
- Change into the project directory:
cd app
Run the following commands to start the Rails development environment:
docker build .
./drun.sh rails new . --database=postgresql
vim ./config/database.yml
Edit the database configuration file in order to get the database connection working. Add the following code under the default
node.
host: <%= ENV["POSTGRES_HOST"] %>
username: <%= ENV["POSTGRES_USER"] %>
password: <%= ENV["POSTGRES_PASSWORD"] %>
And finally:
./drun.sh serve
This command will spin up the necessary containers and configure the Rails environment for you. Once the environment is up and running, you can access your Rails application at http://localhost:3000
.
drun
provides convenient commands for common Rails development tasks. Here are some examples:
- Running rails commands:
./drun.sh rails db:create
,./drun.sh rails console
- Running the server (and database containers):
./drun.sh serve
Feel free to modify the drun.sh
script to include additional commands specific to your project's requirements.
We do not want to create a layer over the Rails learning curve. We encourage you to run
rails
commands. But if you already are familiar with Rails, feel free to improve it. (See above)
Please note the following limitations of drun
:
drun
is primarily designed for beginners and intermediate developers to quickly set up a development environment. It may not include all the dependencies required for complex setups or production environments.- It focuses on the essential dependencies needed when running
rails new
without additional options. Dependencies such as PostgreSQL, Redis, or other services are not included by default.
Contributions to drun
are welcome! If you have any suggestions, improvements, or feature requests, please feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.
This project has been influenced by the ideas and concepts behind Docked, a tool designed to simplify Rails development environments using Docker. We acknowledge the inspiration and appreciate the effort put into creating Docked.