https://github.com/devteds/docker-rails-template
Template that can help create rails application on docker faster.
https://github.com/devteds/docker-rails-template
containerization docker docker-compose mysql rails rails-api rails5 ruby ruby-on-rails
Last synced: 12 months ago
JSON representation
Template that can help create rails application on docker faster.
- Host: GitHub
- URL: https://github.com/devteds/docker-rails-template
- Owner: devteds
- Created: 2017-01-15T03:38:24.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-22T01:27:10.000Z (almost 8 years ago)
- Last Synced: 2025-01-13T17:24:33.146Z (about 1 year ago)
- Topics: containerization, docker, docker-compose, mysql, rails, rails-api, rails5, ruby, ruby-on-rails
- Language: Shell
- Size: 3.91 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ruby On Rails with Docker - Template
Use this code and follow the instructions below to create and run a new rails application using Docker & Docker Compose.
## Tested on
* macOS - 10.12
* Docker - 1.12.6, 1.13.0
* Docker compose - 1.9.0, 1.10.0
## Instructions / commands
```
# Go to your projects or work directory and,
git clone https://github.com/devteds/docker-rails-template.git myapp
cd myapp
rm -rf .git
docker-compose run app rails new . --force --database=mysql --skip-bundle
mv database.yml config/database.yml
docker-compose build
docker-compose up
# http://localhost:3001/
```
## Build your application
Now that you have the rails application setup, start adding features - controllers, views, models, resources, migrations etc.
## Some useful commands
```
bin/d_rails g scaffold post title body:text
# or
# docker-compose run --rm app rails g scaffold post title body:text
bin/d_rails db:migrate
bin/d_rails c
```
## Rails API-only
If you are creating an API-only application, with no UI or web-ui components, you may change the above "rails new ..." command as,
```
docker-compose run app rails new . --force --database=mysql --skip-bundle --api
```