Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zazk/rails-6-docker-alpine
Lightweight Rails 6 App over Docker Alpine images
https://github.com/zazk/rails-6-docker-alpine
docker docker-compose rails rails6
Last synced: 4 days ago
JSON representation
Lightweight Rails 6 App over Docker Alpine images
- Host: GitHub
- URL: https://github.com/zazk/rails-6-docker-alpine
- Owner: zazk
- Created: 2019-09-01T21:10:04.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-09T21:53:07.000Z (over 4 years ago)
- Last Synced: 2024-12-17T11:11:47.837Z (9 days ago)
- Topics: docker, docker-compose, rails, rails6
- Language: Dockerfile
- Homepage:
- Size: 2.93 KB
- Stars: 20
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rails 6 Docker Alpine
Docker image size```sh
$ docker images
REPOSITORY TAG SIZE
blitz_web latest 390MB```
### Steps
1. Clone & Create
```sh
git clone [email protected]:zazk/Rails-6-Docker-Alpine.git
```Create a new Rails application under the repository directory
```sh
cd Rails-6-Docker-Alpine
rails new . --webpack --database=postgresql
```2. Configure:
Modify your database configuration to use the postgresql container configuration:
```yaml
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
host: db
username: postgres
```Remove check Yarn
```yaml
# ./config/environments/development.rb
# Disable Yarn Check
config.webpacker.check_yarn_integrity = false
```3. Build the project:
```sh
docker-compose build
```4. Create the database and run the migrations:
```sh
docker-compose run --rm web bin/rails db:create
docker-compose run --rm web bin/rails db:migrate
```5. Run the app:
```sh
docker-compose up
```Visit your application
```
http://localhost:3000
```### Troubleshooting
1. If you have probles with `pg` gem you should install Postgres before. On Mac `brew install postgres`
2. Ruby Version `2.5.3`