https://github.com/pablovallejo/docker-rails
:rocket: Docker container for Ruby on Rails 5
https://github.com/pablovallejo/docker-rails
containers docker rails ruby
Last synced: about 2 months ago
JSON representation
:rocket: Docker container for Ruby on Rails 5
- Host: GitHub
- URL: https://github.com/pablovallejo/docker-rails
- Owner: PabloVallejo
- Created: 2016-10-15T15:48:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-24T14:29:56.000Z (over 8 years ago)
- Last Synced: 2025-05-16T14:50:43.228Z (about 1 year ago)
- Topics: containers, docker, rails, ruby
- Language: Ruby
- Homepage:
- Size: 2.93 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rails 5 Docker boilerplate
Boilerplate for Rails projects using Docker.
## Building the project
Run the following command to create a new Rails project scaffold with a postgres database.
```bash
docker-compose run web rails new . --force --database=postgresql --skip-bundle
```
In order to have a JavaScript runtime you have to uncomment this line in your Gemfile.
```
gem 'therubyracer', platforms: :ruby
```
After that build the project in order to install new Gems.
```bash
docker-compose build
```
## Database
Use the following configuration for your **development** and **test** databases.
```yaml
development: &default
adapter: postgresql
encoding: unicode
database: postgres
pool: 5
username: postgres
password:
host: db
test:
<<: *default
database: myapp_test
```
After this you can run the project and get ready to create the database.
```bash
$ docker-compose up
```
Run this command to create the database.
```bash
$ docker-compose run web rake db:create
```
## Running
At this point your application must be running on localhost on port 3000, so head over to it and take a look!
[http://localhost:3000](http://localhost:3000)