Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anamba/docker-rails
Docker image for Rails development
https://github.com/anamba/docker-rails
docker docker-image passenger passenger-ruby rails ruby ruby-on-rails
Last synced: 2 months ago
JSON representation
Docker image for Rails development
- Host: GitHub
- URL: https://github.com/anamba/docker-rails
- Owner: anamba
- License: mit
- Created: 2018-12-06T23:45:05.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-22T03:32:08.000Z (7 months ago)
- Last Synced: 2024-06-22T15:41:26.714Z (7 months ago)
- Topics: docker, docker-image, passenger, passenger-ruby, rails, ruby, ruby-on-rails
- Language: Dockerfile
- Size: 28.3 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-rails - Docker image for Rails development
[![Version](https://img.shields.io/github/tag/anamba/docker-rails.svg?maxAge=360)](https://github.com/anamba/docker-rails/tags)
[![License](https://img.shields.io/github/license/anamba/docker-rails.svg)](https://github.com/anamba/docker-rails/blob/master/LICENSE)Docker Hub: [anamba/rails-dev](https://hub.docker.com/r/anamba/rails-dev/)
Based on Phusion's excellent, developer-friendly [passenger-docker](https://github.com/phusion/passenger-docker) image (based on 20.04 LTS aka Focal). Includes fullstaq ruby, which offers improved performance and reduced memory usage.
Primary use cases:
* CI (e.g. Bitbucket Pipelines)
* Local development, VS Code Dev Containers## Contents
Includes:
* MRI Ruby 3.2.2 + Rubygems 3.5.6
* MRI Ruby 3.1.4 + Rubygems 3.5.6
* MRI Ruby 3.0.6 + Rubygems 3.5.6
* MRI Ruby 2.7.8 + Rubygems 3.4.22
* Fullstaq Ruby 3.2.2
* Fullstaq Ruby 3.1.4
* Fullstaq Ruby 3.0.6
* Fullstaq Ruby 2.7.8
* Passenger 6.0.20
* Node 18 + yarn (if you need Node 16, use the latest 1.4 version)
* rvm stableWorking dir is `/home/app/myapp` (user is `app`).
## Versioning
Versioning originally followed passenger-docker, but no longer.
1.5.3: Rebuild
1.5.2: Rebuild
1.5.1: Rebuild
1.5: Added Ruby 3.2, removed 2.6; Node 16 -> 18
1.4.1: Added Ruby 3.2
1.4: Added Ruby 3.1, removed 2.5
1.3: Added Ruby 3.0, removed 2.4; Node 14 -> 16
1.2: Bionic -> Focal; Node 12 -> 14
1.1: Added Ruby 2.7, removed 2.3; includes latest bundler out of the box
1.0: Original release## How to use
Add to nginx vhost steps to Dockerfile (optional):
```
RUN rm -f /etc/nginx/sites-enabled/default
COPY /docker/conf/nginx-vhost.conf.template /etc/nginx/
```Example `docker-compose.yml`:
```yaml
version: '3'services:
web:
image: anamba/rails-dev:1.5
volumes:
- ./:/home/app/myapp
- /home/app/myapp/log # you probably want to keep log and tmp in volumes
- /home/app/myapp/tmp # (especially if your working copy is in Dropbox, etc.)
- gems:/usr/local/rvm/gems # if you want to keep a single gem cache
db:
image: mysql:8.0
volumes:
- /var/lib/mysqlredis:
image: redis:6.0volumes:
gems:
external: true
```From there, you can run `docker-compose up` to start the containers, then, in a separate terminal:
```bash
docker-compose exec -u app web bash -l # user login shell
docker-compose exec web bash -l # root login shell
```You'll want to create aliases or simple shell scripts to save yourself some typing.
## Development
(notes for myself)
```bash
docker build --no-cache -t anamba/rails-dev:latest .# optional: test and make sure everything is installed as expected
docker run -it anamba/rails-dev:latest bash -ldocker tag anamba/rails-dev:latest anamba/rails-dev:1.5.3
docker tag anamba/rails-dev:latest anamba/rails-dev:1.5
docker push anamba/rails-dev:latestdocker push anamba/rails-dev:1.5.3
docker push anamba/rails-dev:1.5
```