Rynaro / drun

Quick Rails setup with docker compose

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

drun

Introduction

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.

Prerequisites

Before using drun, make sure you have the following installed:

  • Docker
  • Docker Compose

Getting Started

To get started with drun, follow these steps:

  1. Clone this repository: git clone https://github.com/Rynaro/drun.git app
  2. Change into the project directory: cd app

Starting the Development Environment

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.

Common Tasks

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)

Limitations

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.

Contributing

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.

License

This project is licensed under the MIT License.

Acknowledgments

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.

About

Quick Rails setup with docker compose

License:MIT License


Languages

Language:Dockerfile 75.8%Language:Shell 24.2%