An open API service indexing awesome lists of open source software.

https://github.com/kerolloz/rails-docker


https://github.com/kerolloz/rails-docker

docker docker-compose postgresql rails redis ruby

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          

# Docker Rails

> The purpose of this very simple web app is to apply some of the knowledge I learned from [Docker for Rails Developers](https://pragprog.com/book/ridocker/docker-for-rails-developers) book _by Rob Isenberg_.

I used _PostgreSQL_ to keep a table of _posts_.
I used _Redis_ to keep a simple counter of _welcome_ page views.

## Requirements

For sure you need to have [Docker](https://docker.io) and [Docker Compose](https://docs.docker.com/compose/install/) installed.

## Usage

Use the following command to run the app on [localhost:3000](localhost:3000)

```sh
docker-compose up -d
```

Use the following commad to migrate the database changes and seed with data

```sh
docker-compose exec web bundle exec rake db:migrate db:seed
```

On you should get


welcome screenshot

On you should get


posts screenshot

Stop the app using `docker-compose down`!

## Testing

[![Ruby](https://github.com/kerolloz/rails-docker/actions/workflows/testing-with-docker.yml/badge.svg)](https://github.com/kerolloz/rails-docker/actions/workflows/testing-with-docker.yml)

```bash
docker-compose up -d
docker-compose run -e "RAILS_ENV=test" web bin/rake db:create db:migrate
docker-compose run -e "RAILS_ENV=test" web bin/rake assets:precompile
docker-compose run -e "RAILS_ENV=test" web bin/rake test
```

## Diagram


diagram image

You can find out more at .