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
- Host: GitHub
- URL: https://github.com/kerolloz/rails-docker
- Owner: kerolloz
- Created: 2020-03-04T00:13:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-19T00:28:33.000Z (almost 3 years ago)
- Last Synced: 2025-04-02T04:18:52.075Z (about 1 year ago)
- Topics: docker, docker-compose, postgresql, rails, redis, ruby
- Language: Ruby
- Size: 688 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
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
On you should get
Stop the app using `docker-compose down`!
## Testing
[](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
You can find out more at .