Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pacuna/rails5-docker-alpine
Lightweight Docker development environment for Rails using Alpine Linux
https://github.com/pacuna/rails5-docker-alpine
alpine alpine-linux containers docker lightweight postgresql rails ruby ruby-on-rails
Last synced: 2 months ago
JSON representation
Lightweight Docker development environment for Rails using Alpine Linux
- Host: GitHub
- URL: https://github.com/pacuna/rails5-docker-alpine
- Owner: pacuna
- Created: 2017-12-16T12:59:17.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-24T03:53:10.000Z (about 6 years ago)
- Last Synced: 2024-11-01T12:42:19.536Z (3 months ago)
- Topics: alpine, alpine-linux, containers, docker, lightweight, postgresql, rails, ruby, ruby-on-rails
- Language: Dockerfile
- Size: 6.84 KB
- Stars: 71
- Watchers: 3
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rails5-docker-alpine
This is a very lightweight Docker image based on Ruby Alpine to run a Rails 5
application.
I also provide a docker-compose file to run your project using a PostgreSQL
database.## Trying out the image
Clone the repository:
```sh
git clone [email protected]:pacuna/rails5-docker-alpine.git
```Create a new Rails application under the repository directory
```sh
cd rails-docker-alpine
rails new . --database=postgresql
```Modify your database configuration to use the postgresql container configuration:
```yaml
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
host: db
username: postgres
```Build the project:
```sh
docker-compose build
```Create the database and run the migrations:
```
docker-compose run --rm web bin/rails db:create
docker-compose run --rm web bin/rails db:migrate
```Run the app:
```sh
docker-compose up -d
```Visit your application at localhost:3000.
Tested with:
- Ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
- Rails 5.2.2 (to create the new application)
- Docker version 18.09.0, build 4d60db4
- docker-compose version 1.23.1, build b02f1306