https://github.com/rails/docked
Running Rails from Docker for easy start to development
https://github.com/rails/docked
Last synced: 8 days ago
JSON representation
Running Rails from Docker for easy start to development
- Host: GitHub
- URL: https://github.com/rails/docked
- Owner: rails
- License: mit
- Created: 2022-12-13T15:28:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-14T03:38:05.000Z (11 months ago)
- Last Synced: 2025-04-01T09:33:30.001Z (15 days ago)
- Language: Dockerfile
- Size: 43.9 KB
- Stars: 1,316
- Watchers: 40
- Forks: 63
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- stars - rails/docked - Running Rails from Docker for easy start to development (Dockerfile)
README
# Docked Rails CLI
Setting up Rails for the first time with all the dependencies necessary can be daunting for beginners. Docked Rails CLI uses a Docker image to make it much easier, requiring only Docker to be installed.
Install [Docker](https://www.docker.com/products/docker-desktop/) (and [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) on Windows). Then copy'n'paste into your terminal:
```bash
docker volume create ruby-bundle-cache
alias docked='docker run --rm -it -v ${PWD}:/rails -u $(id -u):$(id -g) -v ruby-bundle-cache:/bundle -p 3000:3000 ghcr.io/rails/cli'
```Then create your Rails app:
```bash
docked rails new weblog
cd weblog
docked rails generate scaffold post title:string body:text
docked rails db:migrate
docked rails server
```That's it! Your Rails app is running on `http://localhost:3000/posts`.
## Sidenote
`docked` is not intended to replace a full development setup. It is merely a way for newcomers to quickly get started with Rails. The included dependencies stick to what you need when running `rails new` without additional options. It does not include dependencies for running with PostgreSQL or Redis for example.