https://github.com/stemount/ruby-on-rails-docker-compose-template
A docker-compose template of a Ruby on Rails application using Ruby 2.7.2 and Rails 6.x
https://github.com/stemount/ruby-on-rails-docker-compose-template
ruby ruby6
Last synced: about 1 year ago
JSON representation
A docker-compose template of a Ruby on Rails application using Ruby 2.7.2 and Rails 6.x
- Host: GitHub
- URL: https://github.com/stemount/ruby-on-rails-docker-compose-template
- Owner: stemount
- Created: 2020-12-15T20:11:07.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-03-09T00:58:32.000Z (over 3 years ago)
- Last Synced: 2025-05-05T16:16:19.046Z (about 1 year ago)
- Topics: ruby, ruby6
- Language: Ruby
- Homepage:
- Size: 2.79 MB
- Stars: 5
- Watchers: 1
- Forks: 6
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- Security: SECURITY.md
Awesome Lists containing this project
README

#### → Getting started with this project
This uses `docker-compose` for simplicity of getting together a Ruby on Rails 6 application with a PostgreSQL database.
**Start containers**
```bash
docker-compose up -d
```
**Restart Ruby instance**
```bash
docker-compose restart web
```
**Destroy PostgreSQL databases if you mess up or similar reason**
This nukes the `PGDATA` contents including databases, passwords et al.
Useful if you are testing migrations or are prototyping your database model.
```bash
rm -rf ./tmp/db/* && docker-compose up --force-recreate postgres
```
**Stop containers**
```bash
docker-compose stop
```
---
#### → Start Developing
It is required to create the databases using Rails.
It is recommended to use migration files over any sort of hacks.
It is recommended to have seed data to test your models too.
- **How to interact with the Rails docker instance**
```bash
docker-compose exec web /bin/bash
```
**These commands will be essential**
- `rails db:create`
- `rails db:migrate`
- `rails db:seed`
---
###### Technical Info
**Rails version:** 6.1
**Ruby version:** ruby 2.7.2
**Base Linux distro:** Debian Buster
###### Default settings
**PostgreSQL User**: `root` **PostgreSQL Password**: `password`